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.70%. Comparing base (f373787) to head (28f9473).

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.70%   82.70%           
=======================================
  Files          42       42           
  Lines       35770    35787   +17     
  Branches    35770    35787   +17     
=======================================
+ Hits        29584    29599   +15     
- Misses       2668     2672    +4     
+ Partials     3518     3516    -2     

☔ 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 6 times, most recently from c7ad4b4 to b634cfd Compare October 31, 2026 10:34
@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/foreign-table-column-options branch from b634cfd to 28f9473 Compare October 31, 2026 12:46
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