Skip to content

PostgreSQL: Support column OPTIONS in CREATE FOREIGN TABLE - #2755

Open
LucaCappelletti94 wants to merge 1 commit into
mainfrom
upstream/foreign-table-column-options
Open

LucaCappelletti94 wants to merge 1 commit into
mainfrom
upstream/foreign-table-column-options

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

CREATE FOREIGN TABLE ft (id INT OPTIONS (column_name 'remote_id')) SERVER s failed at OPTIONS. The column option now parses as ColumnOption::GenericOptions behind a new Dialect::supports_column_generic_options, enabled for PostgreSQL. The Generic dialect keeps BigQuery's OPTIONS(key = value) form, which uses the same keyword. PostgreSQL's grammar takes the clause on any column definition and refuses it on a table that is not foreign only at execution, so CREATE TABLE accepts it too.

https://www.postgresql.org/docs/current/sql-createforeigntable.html

@codecov-commenter

codecov-commenter commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.61%. Comparing base (1e0bc45) to head (627d318).

Files with missing lines Patch % Lines
src/ast/spans.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2755   +/-   ##
=======================================
  Coverage   82.61%   82.61%           
=======================================
  Files          42       42           
  Lines       35614    35631   +17     
  Branches    35614    35631   +17     
=======================================
+ Hits        29421    29438   +17     
- Misses       2659     2663    +4     
+ Partials     3534     3530    -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/foreign-table-column-options branch 5 times, most recently from a747dd5 to 035b5a6 Compare October 30, 2026 08:30

@sabir-akhadov-localstack sabir-akhadov-localstack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/foreign-table-column-options branch from 035b5a6 to b23a507 Compare October 30, 2026 10:58
@@ -0,0 +1 @@
CREATE FOREIGN TABLE ft (id INT OPTIONS (column_name 'remote_id') NOT NULL) SERVER s No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these files supposed to have an ending new line? I see a mix of both.

@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/foreign-table-column-options branch 2 times, most recently from a55cc61 to 88bff36 Compare October 30, 2026 17:38
@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/foreign-table-column-options branch from 88bff36 to 627d318 Compare October 30, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants