Foreign Keys and ALTER RENAME TABLE

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Foreign Keys and ALTER RENAME TABLE
Дата
Msg-id 011301c0fcbf$79be4680$1600a8c0@jester
обсуждение исходный текст
Список pgsql-bugs
It doesn't appear that Foreign keys are updated when renaming the
table.  Causing references to become non-existant.


create table foobar ( id SERIAL);

INSERT INTO foobar DEFAULT VALUES;

INSERT INTO foobar DEFAULT VALUES;

INSERT INTO foobar DEFAULT VALUES;

create table barfoo (id int4 REFERENCES foobar (id) ON UPDATE CASCADE
ON DELETE CASCADE);



update foobar set id = 10 where id = 1;

-- Works as expected

alter table barfoo rename to farboo;

-- No warnings from above line!



update foobar set id = 12 where id = 2;

-- ERROR: Relation 'barfoo' does not exist


--
Rod Taylor

Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. You cannot imagine why you ever felt
otherwise.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Steve Pothier
Дата:
Сообщение: Re: COPY TO looses on view
Следующее
От: Emil Goldfrab
Дата:
Сообщение: Bug with POSTGRESQL JDBC Driver 7.1 -1.2