FOREIGN TABLE and IDENTITY columns

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: FOREIGN TABLE and IDENTITY columns
Date: 2024-10-08 14:26:50
Message-ID: ZwVBKrwe852_bd_l@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I was looking at the CREATE FOREIGN TABLE documentation to see if IDENTITY
columns were supported, and according to the doc they're not: only GENERATED
ALWAYS AS ( expr ) STORED is supported.

However, a quick test shows that this is supported (same as serial datatype),
and apparently behaves as expected. Looking at the grammar, CreateStmt and
CreateForeignTableStmt actually share the same rule for the column definitions
(OptTableElementList) so the behavior seems expected. The parse analysis code
is also mostly shared between the two, with only a few stuff explicitly
forbidden for foreign tables (primary keys and such).

It looks like this is just an oversight in the documentation? If so, it seems
like the CREATE and ALTER FOREIGN TABLE pages needs to be updated. The ALTER
FOREIGN TABLE page is also at least lacking the SET / DROP EXPRESSION clauses.

I'm attaching an initial patch for the missing parts that I could spot after a
quick look.

Attachment Content-Type Size
cft_doc.diff text/plain 5.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey M. Borodin 2024-10-08 14:33:03 Re: [PATCH] Add min/max aggregate functions to BYTEA
Previous Message Aleksander Alekseev 2024-10-08 14:23:54 Re: [PATCH] Add min/max aggregate functions to BYTEA