dbTalk Databases Forums  

Modifying an existing constraint?

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Modifying an existing constraint? in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lynna Landstreet
 
Posts: n/a

Default Modifying an existing constraint? - 06-04-2004 , 06:03 PM






Hi there,

Does anyone know if it's possible to modify an existing table constraint -
for example, to add "ON DELETE CASCADE" to an existing foreign key
constraint? Or would I have to recreate the table to add that?


Lynna

--
Resource Centre Database Coordinator
Gallery 44
www.gallery44.org


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


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

Default Re: Modifying an existing constraint? - 06-04-2004 , 11:46 PM






Lynna Landstreet <lynna (AT) gallery44 (DOT) org> writes:
Quote:
Does anyone know if it's possible to modify an existing table constraint -
for example, to add "ON DELETE CASCADE" to an existing foreign key
constraint? Or would I have to recreate the table to add that?
There's no command to modify a foreign key constraint like that, but you
should be able to drop and re-add that single constraint using ALTER TABLE.
I don't see a reason to recreate the whole table...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



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.