pgsql: Allow CHECK constraints to be placed on foreign tables.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow CHECK constraints to be placed on foreign tables.
Date: 2014-12-17 22:01:05
Message-ID: E1Y1MeX-00075v-RL@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow CHECK constraints to be placed on foreign tables.

As with NOT NULL constraints, we consider that such constraints are merely
reports of constraints that are being enforced by the remote server (or
other underlying storage mechanism). Their only real use is to allow
planner optimizations, for example in constraint-exclusion checks. Thus,
the code changes here amount to little more than removal of the error that
was formerly thrown for applying CHECK to a foreign table.

(In passing, do a bit of cleanup of the ALTER FOREIGN TABLE reference page,
which had accumulated some weird decisions about ordering etc.)

Shigeru Hanada and Etsuro Fujita, reviewed by Kyotaro Horiguchi and
Ashutosh Bapat.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fc2ac1fb41c2defb8caf825781af75db158fb7a9

Modified Files
--------------
contrib/file_fdw/input/file_fdw.source | 16 +++-
contrib/file_fdw/output/file_fdw.source | 32 ++++++-
contrib/postgres_fdw/expected/postgres_fdw.out | 85 ++++++++++++++++++
contrib/postgres_fdw/sql/postgres_fdw.sql | 30 +++++++
doc/src/sgml/ref/alter_foreign_table.sgml | 113 ++++++++++++++++++------
doc/src/sgml/ref/create_foreign_table.sgml | 65 +++++++++++++-
src/backend/catalog/heap.c | 9 +-
src/backend/commands/tablecmds.c | 8 +-
src/backend/parser/parse_utilcmd.c | 51 ++++++++---
src/test/regress/expected/foreign_data.out | 57 ++++++++++--
src/test/regress/sql/foreign_data.sql | 28 +++++-
11 files changed, 432 insertions(+), 62 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2014-12-18 03:53:36 pgsql: Lock down regression testing temporary clusters on Windows.
Previous Message Heikki Linnakangas 2014-12-17 19:55:38 pgsql: Clarify the regexp used to detect source files in MSVC builds.