Re: Inserting into foreign table with sequences and default values

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Inserting into foreign table with sequences and default values
Дата
Msg-id 1468017.1702060306@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Inserting into foreign table with sequences and default values  ("peter.borissow@kartographia.com" <peter.borissow@kartographia.com>)
Ответы Re: Inserting into foreign table with sequences and default values
Список pgsql-general
"peter.borissow@kartographia.com" <peter.borissow@kartographia.com> writes:
> I guess the FDW is not "seeing" the default value for status and the bigserial sequence for the id column. Is there
anywayaround this? 

The idea is that you should attach default clauses to the foreign
table definition.  A remote serial column is a hard case for that,
though, since you don't have ready access to the remote sequence.
Because of that and some related examples, we don't currently
expect that IMPORT FOREIGN SCHEMA should import the defaults that
exist on the remote server.

Using a view or trigger on the remote side is currently the best
way around that for cases where you can't set up a suitable
default on the local table.

            regards, tom lane



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

Предыдущее
От: Vincent Veyron
Дата:
Сообщение: Re: running \copy through perl dbi ?
Следующее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Store PDF files in PostgreDB