]> granicus.if.org Git - postgresql/commit
Allow default expressions to be attached to columns of foreign tables.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 12 Mar 2013 21:37:07 +0000 (17:37 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 12 Mar 2013 21:37:07 +0000 (17:37 -0400)
commita0c6dfeecfcc860858b04617a9d96eaee1d82c66
treecb4fc000b7fd65b73974633c2eb75742516f16cb
parent1ba0119308e74e522c75662147d89d154f45bb5d
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.
doc/src/sgml/ref/alter_foreign_table.sgml
doc/src/sgml/ref/create_foreign_table.sgml
src/backend/commands/tablecmds.c
src/backend/parser/gram.y
src/backend/parser/parse_utilcmd.c
src/test/regress/expected/foreign_data.out
src/test/regress/sql/foreign_data.sql