On Feb 3, 2025 at 08:29 +0800, Michael Paquier <mich...@paquier.xyz>, wrote:
> On Mon, Feb 03, 2025 at 06:22:13AM +0800, Mingli Zhang wrote:
> > Yes, I would like to provide a patch.
> >
> > Glad to see we have come to an agreement on this.
>
> Just adding my +1 here. FWIW.
Hi,

Patch added.

Added support for CREATE FOREIGN TABLE LIKE to enable the creation of foreign 
tables based on the column definitions, constraints of existing source tables.
This feature mirrors the behavior of CREATE TABLE LIKE, but ignores 
inapplicable options such as INCLUDING INDEXES and INCLUDING COMPRESSION for 
foreign tables.

I have disallowed the COMPRESSION option due to existing inconsistencies 
between STORAGE and COMPRESSION.
I’ve posted a summary of these issues at Inconsistency between Compression and 
Storage for Foreign Tables[0].

Once we align the behavior of STORAGE and COMPRESSION, I believe that 
COMPRESSION should also be copied for foreign tables, similar to STORAGE.
This might be beneficial for foreign data wrappers (FDWs) that take it into 
account.


[0] 
https://www.postgresql.org/message-id/6cecef0e-ee14-473c-bb0a-6aa61f539a66%40Spark

--
Zhang Mingli
HashData

Attachment: v0-0001-CREATE-FOREIGN-TABLE-LIKE.patch
Description: Binary data

Reply via email to