pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add support for LIKE in CREATE FOREIGN TABLE
Date: Wed, 19 Feb 2025 06:51:43 +0000
Message-ID: <E1tkdvs-0005c2-1x@gemulon.postgresql.org> (raw)

Add support for LIKE in CREATE FOREIGN TABLE

LIKE enables the creation of foreign tables based on the column
definitions, constraints and objects of the defined source relation(s).

This feature mirrors the behavior of CREATE TABLE LIKE, but ignores
the INCLUDING sub-options that do not make sense for foreign tables:
INDEXES, COMPRESSION, IDENTITY and STORAGE.  The supported sub-options
are COMMENTS, CONSTRAINTS, DEFAULTS, GENERATED and STATISTICS, mapping
with the clauses already supported by the command.

Note that the restriction with LIKE in CREATE FOREIGN TABLE was added in
a0c6dfeecfcc.

Author: Zhang Mingli
Reviewed-by: Álvaro Herrera, Sami Imseih, Michael Paquier
Discussion: https://postgr.es/m/42d3f855-2275-4361-a42a-826172ca2dc4@Spark

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/302cf15759233e654512979286ce1a5c3b36625f

Modified Files
--------------
doc/src/sgml/ref/create_foreign_table.sgml      | 114 +++++++++++++++++++++++-
src/backend/parser/parse_utilcmd.c              |  24 ++---
src/test/regress/expected/create_table_like.out | 103 +++++++++++++++++++++
src/test/regress/sql/create_table_like.sql      |  42 +++++++++
4 files changed, 271 insertions(+), 12 deletions(-)



Message-ID: <E1tkdvs-0005c2-1x@gemulon.postgresql.org>
Permalink:  ../E1tkdvs-0005c2-1x@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tkdvs-0005c2-1x@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add support for LIKE in CREATE FOREIGN TABLE
  In-Reply-To: <E1tkdvs-0005c2-1x@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox