Re: Can a table have a reference to itself?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Can a table have a reference to itself?
Дата
Msg-id 27090.1059370289@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Can a table have a reference to itself?  (Oliver Duke-Williams <o.duke-williams@geog.leeds.ac.uk>)
Список pgsql-sql
Oliver Duke-Williams <o.duke-williams@geog.leeds.ac.uk> writes:
> So far so good, but what I'd like to do is to be able to change a value 
> of a, and have this cascaded to b; however this gives an integrity 
> violation error:

>> update foo set a = 5 where a = 2;
> ERROR:  chk_a referential integrity violation - key referenced from foo 
> not found in foo

Seems to work in 7.3.4 and CVS tip:

regression=# update foo set a = 5 where a = 2;
UPDATE 1
regression=# select * from foo;a | b
---+---1 | 13 | 55 | 5
(3 rows)
        regards, tom lane


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

Предыдущее
От: "David Witham"
Дата:
Сообщение: Using a compound primary key
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Using a compound primary key