Re: foreign keys to foreign tables
| От | Tom Lane |
|---|---|
| Тема | Re: foreign keys to foreign tables |
| Дата | |
| Msg-id | 4841.1434990074@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | foreign keys to foreign tables (Rick Otten <rottenwindfish@gmail.com>) |
| Ответы |
Re: foreign keys to foreign tables
Re: foreign keys to foreign tables |
| Список | pgsql-general |
Rick Otten <rottenwindfish@gmail.com> writes:
> Hello pgsql-general,
> I'd like to set up a foreign key constraint to a foreign table from a local
> table.
> ie, I have a column in a local table that I'd like to ensure has a value in
> the foreign table.
> alter mytable
> add column some_column_id uuid references myforeigntable(some_column_id)
> ;
> Unfortunately I get a "not a table" error when I try this.
> ERROR: referenced relation "myforeigntable" is not a table
> I'm thinking I'll have to write a function that checks for existance of the
> ids in the foreign table, and then put a CHECK constraint on using that
> function, but I thought I'd as first if there was a better way.
What's going to happen when the foreign server decides to delete some rows
from its table?
regards, tom lane
В списке pgsql-general по дате отправления: