-
Notifications
You must be signed in to change notification settings - Fork 166
Reject zero-column table creation with AO column storage #1163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I have two concerns about the issue:
|
create a table with one column, then drop the column. Same concern, create a table with zero column is valid in Postgres/GPDB. |
create a table with one column, then drop the column. Same concern, create a table with zero column is valid in Postgres/GPDB.
Designed to be valid.
|
fec6f10 try to reject , if agreed, then I will add related testcase. |
Yes. The normal table with columns may drop columns one by one, until to have no column. This PR only disallow aocs table to create a zero-column table, but we may still have zero-column table in other table storage. |
src/test/regress/sql/misc_jiras.sql
Outdated
|
||
-- Github Issue 1055 | ||
-- AO column storage not supported for zero-column tables | ||
set default_table_access_method = ao_column; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add more test cases here:
alter table ... drop column ...
to drop columns one by one until to zero-column.alter table ... set access method
from other type of table storage to aocs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop columns one by one until to zero-column
wild to reject drop column to zero ?
d4d3540
to
59af48e
Compare
Creating a table with AO columnar storage and no columns is not supported. This patch adds an explicit check in DefineRelation() to throw an error when such a case is encountered. This ensures users receive a clear error message rather than encountering undefined behavior. Also adds a regression test under misc_jiras to verify the behavior. Reported-by: GitHub Issue apache#1055
Creating a table with AO columnar storage and no columns is not supported. This patch adds an explicit check in DefineRelation() to throw an error when such a case is encountered. This ensures users receive a clear error message rather than encountering undefined behavior.
Also adds a regression test under misc_jiras to verify the behavior.
Fixes #1055
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheck
make -C src/test installcheck-cbdb-parallel
Impact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions