Search Postgresql Archives

Re: Modifying a foreign key constraint?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Broersma Jr wrote:

Sure there is, you can preform multiple alterations in one statement:

ALTER TABLE foo DROP CONSTRAINT foo_bar_id_fkey,
                ADD CONSTRAINT foo_bar_id_fkey
                FOREIGN KEY (bar_fkey)
                REFERENCES bar (id)
                ON DELETE CASCADE;

Doh!  That's perfectly fine, of course.

I was wondering if there might be something along the lines of an ALTER CONSTRAINT clause, which could change a specific aspect of a constraint without having to re-specify the whole thing.

		Marc


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux