Re: Missing importing option of postgres_fdw

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Missing importing option of postgres_fdw
Дата
в 19:50:12
Msg-id
23896.1432577724@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Michael Paquier <michael.paquier@gmail.com>
Re: Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Michael Paquier <michael.paquier@gmail.com>
Re: Missing importing option of postgres_fdw Robert Haas <robertmhaas@gmail.com>
Re: Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Robert Haas <robertmhaas@gmail.com>
Re: Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Robert Haas <robertmhaas@gmail.com>
Re: Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Tom Lane <tgl@sss.pgh.pa.us>
Re: Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Re: Missing importing option of postgres_fdw Tom Lane <tgl@sss.pgh.pa.us>
Re: Missing importing option of postgres_fdw Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Etsuro Fujita  writes:
> On 2015/05/22 23:50, Tom Lane wrote:
>> So I think worrying about convalidated is pretty pointless.  Really,
>> it is up to the user to determine what constraints should be attached
>> to the foreign table, and IMPORT FOREIGN SCHEMA can't help much.

> Agreed.  So, I'd like to propose to update the docs as above.  Please
> find attached a patch.  The existing sentence "Checking other types of
> constraints is always left to the remote server." sounds to me that
> constraints on foreign tables are enforced locally when updating the
> foreign tables.  So, I'd also like to propose to remove that sentence.
> Maybe I'm missing something though.

Yeah, I agree this documentation is inadequate; but I think it'd be a good
thing to spell out the reason why there's no support for importing check
constraints.  I committed the attached enlarged version.

			regards, tom lane

diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml
index 1079140..14b12e3 100644
*** a/doc/src/sgml/postgres-fdw.sgml
--- b/doc/src/sgml/postgres-fdw.sgml
***************
*** 309,316 ****
      using .  This command creates
      foreign table definitions on the local server that match tables or
      views present on the remote server.  If the remote tables to be imported
!     have columns of user-defined data types, the local server must have types
!     of the same names.
     
  
     
--- 309,316 ----
      using .  This command creates
      foreign table definitions on the local server that match tables or
      views present on the remote server.  If the remote tables to be imported
!     have columns of user-defined data types, the local server must have
!     compatible types of the same names.
     
  
     
***************
*** 361,369 ****
  
     
      Note that constraints other than NOT NULL</> will never be
!     imported from the remote tables, since PostgreSQL</>
!     does not support any other type of constraint on a foreign table.
!     Checking other types of constraints is always left to the remote server.
     
    
   
--- 361,376 ----
  
     
      Note that constraints other than NOT NULL</> will never be
!     imported from the remote tables.  Although PostgreSQL</>
!     does support CHECK</> constraints on foreign tables, there is no
!     provision for importing them automatically, because of the risk that a
!     constraint expression could evaluate differently on the local and remote
!     servers.  Any such inconsistency in the behavior of a CHECK</>
!     constraint could lead to hard-to-detect errors in query optimization.
!     So if you wish to import CHECK</> constraints, you must do so
!     manually, and you should verify the semantics of each one carefully.
!     For more detail about the treatment of CHECK</> constraints on
!     foreign tables, see .
     
    
   
В списке pgsql-hackers по дате отправления
От: Andrew Dunstan
Дата:
От: Alvaro Herrera
Дата:
FAQ