Skip to content

Fix PostgreSQL timestamptz db_type override alias matching. - #4486

Open
marcusacosta wants to merge 1 commit into
sqlc-dev:mainfrom
marcusacosta:fix/2914-timestamptz-aliases
Open

Fix PostgreSQL timestamptz db_type override alias matching.#4486
marcusacosta wants to merge 1 commit into
sqlc-dev:mainfrom
marcusacosta:fix/2914-timestamptz-aliases

Conversation

@marcusacosta

Copy link
Copy Markdown

Summary

  • Canonicalize PostgreSQL datetime type aliases before comparing db_type overrides in MatchesColumn, so timestamptz, timestamp with time zone, and pg_catalog.timestamptz are treated as equivalent
  • Add unit tests for timestamptz alias matching and an end-to-end testdata fixture verifying both spellings generate the same overridden Go type

Fixes #2914

Test plan

  • go test ./internal/codegen/golang/opts/... -run TestMatchesColumnTimestamptzAliases
  • go test ./internal/endtoend/... -run 'TestReplay/base/overrides_timestamptz_alias'
Canonicalize PostgreSQL datetime type names before comparing db_type
overrides so timestamptz and timestamp with time zone are treated as
equivalent. Fixes sqlc-dev#2914.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant