pgsql: Allow default expressions to be attached to columns of foreign t

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow default expressions to be attached to columns of foreign t
Date: 2013-03-12 21:37:23
Message-ID: E1UFWst-0005Sc-Sw@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow default expressions to be attached to columns of foreign tables.

There's still some discussion about exactly how postgres_fdw ought to
handle this case, but there seems no debate that we want to allow defaults
to be used for inserts into foreign tables. So remove the core-code
restrictions that prevented it.

While at it, get rid of the special grammar productions for CREATE FOREIGN
TABLE, and instead add explicit FEATURE_NOT_SUPPORTED error checks for the
disallowed cases. This makes the grammar a shade smaller, and more
importantly results in much more intelligible error messages for
unsupported cases. It's also one less thing to fix if we ever start
supporting constraints on foreign tables.

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/ref/alter_foreign_table.sgml | 19 +++++++++-
doc/src/sgml/ref/create_foreign_table.sgml | 31 ++++++++++++++-
src/backend/commands/tablecmds.c | 14 +------
src/backend/parser/gram.y | 38 ++++--------------
src/backend/parser/parse_utilcmd.c | 57 +++++++++++++++++++++++++--
src/test/regress/expected/foreign_data.out | 21 +++++-----
src/test/regress/sql/foreign_data.sql | 7 +--
7 files changed, 123 insertions(+), 64 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-03-12 22:58:22 pgsql: Fix contrib/postgres_fdw's handling of column defaults.
Previous Message Alvaro Herrera 2013-03-12 15:29:28 pgsql: Fix orthotypographical mistake