dbTalk Databases Forums  

[BUGS] BUG #1079: ALTER TABLE does not add foreign key

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1079: ALTER TABLE does not add foreign key in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1079: ALTER TABLE does not add foreign key - 02-11-2004 , 12:26 PM







The following bug has been logged online:

Bug reference: 1079
Logged by: Vladimir Sitarchuk

Email address: vova (AT) densoft (DOT) com.ua

PostgreSQL version: 7.3

Operating system: Red Hat 9

Description: ALTER TABLE does not add foreign key

Details:

ALTER TABLE tablename ADD COLUMN columnname INT CONSTRAIN cntrname
REFERENCES tablename2(col)
adds the column But it does not add the foreign key constrain.



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org

Reply With Quote
  #2  
Old   
Richard Huxton
 
Posts: n/a

Default Re: [BUGS] BUG #1079: ALTER TABLE does not add foreign key - 02-11-2004 , 12:52 PM






On Wednesday 11 February 2004 17:29, PostgreSQL Bugs List wrote:
Quote:
The following bug has been logged online:

Bug reference: 1079
Logged by: Vladimir Sitarchuk
Email address: vova (AT) densoft (DOT) com.ua

PostgreSQL version: 7.3
Operating system: Red Hat 9
Description: ALTER TABLE does not add foreign key

Details:
ALTER TABLE tablename ADD COLUMN columnname INT CONSTRAIN cntrname
REFERENCES tablename2(col)
adds the column But it does not add the foreign key constrain.
Perhaps the manual should be clearer on this.

You can add a foreign key with something like (example from manual):
ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address)
REFERENCES addresses(address) MATCH FULL;
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1079: ALTER TABLE does not add foreign key - 02-11-2004 , 01:20 PM



"PostgreSQL Bugs List" <pgsql-bugs (AT) postgresql (DOT) org> writes:
Quote:
ALTER TABLE tablename ADD COLUMN columnname INT CONSTRAIN cntrname
REFERENCES tablename2(col)
adds the column But it does not add the foreign key constrain.
This was fixed as of 7.3.3.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.