Repository navigation
fix: BY DEFAULT identity columns must not be is_generated (#224) - #226
Merged
Merged
Conversation
#223 added `a.attidentity IN ('a', 'd')` to the is_generated check in all four get_columns queries. `attidentity = 'd'` is GENERATED BY DEFAULT AS IDENTITY, which accepts explicit values — only `'a'` (ALWAYS) rejects them. Marking BY-DEFAULT identity columns as is_generated blocked table copy for the common case of a BY-DEFAULT identity primary key. Fix: change `IN ('a', 'd')` to `= 'a'` in all four queries (metadata.rs lines 167, 241, 772, 1404). is_auto_increment stays true for both. Live test: creates a table with all four identity/generated shapes (BY DEFAULT identity PK, ALWAYS identity, stored generated, plain column) and asserts is_generated is present only for ALWAYS identity and stored generated — absent for BY DEFAULT and plain. Co-Authored-By: Adam J Esslinger <esslinger@gmail.com>
#224) The ensemble review found 3 of 4 is_generated SQL query sites had zero test coverage for the = 'a' change. Add 3 live tests: 1. get_schema_snapshot_by_default_identity_is_not_generated — exercises fetch_all_columns (line 1404) via get_schema_snapshot; asserts the same 4 identity/generated shapes as the get_columns test. 2. get_view_columns_never_reports_is_generated — exercises get_view_columns (line 772, the COALESCE/LEFT JOIN path); verifies no view column is marked is_generated (views can't have identity/generated columns). 3. get_materialized_view_columns_never_reports_is_generated — exercises fetch_materialized_view_columns (line 241); same assertion for materialized views. All 4 paths now have dedicated live tests. Verified passing against PostgreSQL 16. Co-Authored-By: Adam J Esslinger <esslinger@gmail.com>
aesslinger
added a commit
that referenced
this pull request
Dec 3, 2026
Bumps version to 1.0.0-rc.16 in .tabularium, Cargo.toml, Cargo.lock, and the CHANGELOG. This release includes manual commit mode (#219), the read_rows server-text read path (#225, #227), and the copy fixes from #220/#221, #222/#223 and #224/#226. Known limitations: money[] locale text form and composite types named like built-ins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#223 added
a.attidentity IN ('a', 'd')to theis_generatedcheck in all fourget_columnsqueries.attidentity = 'd'isGENERATED BY DEFAULT AS IDENTITY, which accepts explicit values — only'a'(ALWAYS) rejects them. Marking BY-DEFAULT identity columns asis_generatedblocked table copy for the common case of a BY-DEFAULT identity primary key.Regression from #223, found by retesting merged
mainagainst PostgreSQL 16. Should be fixed before rc.16.Fix
Changed
IN ('a', 'd')→= 'a'in all fouris_generatedqueries inmetadata.rs(lines 167, 241, 772, 1404).is_auto_incrementstaystruefor both identity kinds.attidentityis_generated(before)is_generated(after)BY DEFAULTidentity'd'ALWAYSidentity'a'''(attgenerated <> '')''Test
Live test (
get_columns_by_default_identity_is_not_generated) creates a table with all four shapes and assertsis_generatedis present only for ALWAYS identity and stored generated — absent for BY DEFAULT and plain. Verified passing against PostgreSQL 16.Closes #224