Re: Proposal to CREATE FOREIGN TABLE LIKE

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
Cc: Sami Imseih <samimseih(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal to CREATE FOREIGN TABLE LIKE
Date: 2025-02-19 06:53:11
Message-ID: Z7V_12JOr5FhUINp@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 18, 2025 at 08:43:02PM +0800, Zhang Mingli wrote:
> On Feb 18, 2025 at 09:54 +0800, Zhang Mingli <zmlpostgres(at)gmail(dot)com>, wrote:
> >
> > Will address the comments later,  thanks for review!
>
> Done in patch v6.

There was a hole in the tests for the option LIKE_STORAGE. Removing
the check for it in transformTableLikeClause() did now show a diff in
the tests. In the case of foreign tables, extended for storage is a
correct choice when using a text type for an attribute. It makes more
sense to use something like "main" on the origin table, then check
that the foreign table uses "extended", for example.

\d+ for a foreign table has no compression field, so using
HIDE_TOAST_COMPRESSION has no meaning. Removing the check for the
option LIKE_COMPRESSION leads to no diffs in the regression tests.

The other two restrictions for indexes and identity were OK.

The docs are fine after a closer look, relying mostly on the clauses
supported by the CREATE FOREIGN TABLE command, tweaked a bit the part
at the bottom where LIKE is not part of the standard.

And applied.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Belyashov 2025-02-19 06:55:08 Re: BUG #18815: Logical replication worker Segmentation fault
Previous Message Tom Lane 2025-02-19 06:48:53 Re: missing assert in makeString