Skip to content

Accept TABLESPACE pg_default as a no-op in CREATE TABLE and ALTER TABLE - #3959

Open
draarivpatel-ui wants to merge 1 commit into
dolthub:mainfrom
draarivpatel-ui:accept-pg-default-tablespace
Open

draarivpatel-ui wants to merge 1 commit into
dolthub:mainfrom
draarivpatel-ui:accept-pg-default-tablespace

Conversation

@draarivpatel-ui

Copy link
Copy Markdown

Fixes #3818

pg_default is PostgreSQL's default tablespace, so CREATE TABLE ... TABLESPACE pg_default places the table exactly where it would land anyway. pgAdmin and pg_dump emit the clause on ordinary tables, which makes PostgreSQL migrations fail on DoltgreSQL.

This change accepts pg_default as a no-op in the two spots that reject the clause outright: CREATE TABLE (nodeCreateTable) and ALTER TABLE ... ADD CONSTRAINT ... USING INDEX TABLESPACE (nodeUniqueConstraintTableDef). Any other tablespace name still returns TABLESPACE is not yet supported, matching the existing inline index handling in nodeIndexTableDef.

Added server/ast/create_table_test.go covering both accepted and rejected names for each path.

pg_default is PostgreSQL's default tablespace, so naming it changes nothing,
but pgAdmin and pg_dump emit the clause on ordinary tables. Real
tablespaces still report TABLESPACE is not yet supported.

Fixes dolthub#3818.
Copilot AI balanced review requested due to automatic review settings November 24, 2026 19:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

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.

CREATE TABLE ... TABLESPACE pg_default fails: TABLESPACE is not yet supported

3 participants