| От | Tom Lane |
|---|---|
| Тема | Re: oid and oidvector |
| Дата | |
| Msg-id | 26386.1018903017@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: oid and oidvector (Bruce Momjian <pgman@candle.pha.pa.us>) |
| Ответы |
Re: oid and oidvector
|
| Список | pgsql-sql |
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> No, you can't use oid as a foreign key. You must use a PRIMARY column.
Oh?
regression=# create table foo(f1 int);
CREATE
regression=# create unique index fooi on foo(oid);
CREATE
regression=# create table bar (ref oid references foo(oid));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
CREATE
regression=#
I agree with the advice *not* to do this, but that doesn't mean it can't
be done.
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера