FK creation -- "ON DELETE NO ACTION" seems to be a no-op
От | Webb Sprague |
---|---|
Тема | FK creation -- "ON DELETE NO ACTION" seems to be a no-op |
Дата | |
Msg-id | b11ea23c0712211122j3162f0d9s756928a0681dcd64@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: FK creation -- "ON DELETE NO ACTION" seems to be a
no-op
|
Список | pgsql-general |
Hi list, First, my select version() gives: PostgreSQL 8.2.4 on x86_64-pc-linux-gnu, compiled by GCC x86_64-pc-linux-gnu-gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.2) The Problem: when I run ALTER TABLE currentsessions ADD CONSTRAINT currentsessions_username_fkey FOREIGN KEY (username) REFERENCES authorizedusers on delete no action on update cascade; It is not updating the table correctly to reflect the "no action". After \d currentsessions (and some editing) I get the following, which, as I understand it, should say something about the "ON DELETE NO ACTION": ... "currentsessions_username_fkey" FOREIGN KEY (username) REFERENCES authorizedusers(username) ON UPDATE CASCADE However, if I drop the constraint and rebuild it with ALTER TABLE currentsessions ADD CONSTRAINT currentsessions_username_fkey FOREIGN KEY (username) REFERENCES authorizedusers on delete cascade on update cascade; I get: ... "currentsessions_username_fkey" FOREIGN KEY (username) REFERENCES authorizedusers(username) ON UPDATE CASCADE ON DELETE CASCADE Is this a bug or a strange thing I had thought I understood? Or has it been fixed in 8.2.5 ("Fix incorrect handling of some foreign-key corner cases (Tom)" -- from the release notes) If anyone wants more data, just holler. Thanks W
В списке pgsql-general по дате отправления: