Skip to content

fix(postgres): auto-name unnamed indexes + release pg client once (1.4.1) - #33

Merged
ihistand merged 1 commit into
mainfrom
fix/postgres-index-name-and-client-release
Jun 17, 2026
Merged

fix(postgres): auto-name unnamed indexes + release pg client once (1.4.1)#33
ihistand merged 1 commit into
mainfrom
fix/postgres-index-name-and-client-release

Conversation

@ihistand

Copy link
Copy Markdown
Collaborator

Fixes two Postgres adapter bugs found in the 1.4.0 acceptance pass (#17).

#31 (blocker) — a postgres.indexes entry without a name generated CREATE [UNIQUE] INDEX "" ... -> zero-length delimited identifier, failing table creation. Now derives a name (<table>_<cols>_idx, _key for unique, truncated to 63 chars) when omitted, mirroring Postgres's own default naming.

#32 — on any failing statement the pg client was released twice (query/client error handler + the finally block), so pg-pool's throwOnDoubleRelease printed a confusing Release called on client which has already been released ahead of the real error. Now released exactly once via a guard.

Tests: unit test for the derived index name; integration tests against real Postgres for the unnamed-index create and for no double-release noise on a failing statement. //cli/api:execution_sql_test and //tests/integration:postgres.spec pass.

Bumps SQLANVIL_VERSION 1.4.0 -> 1.4.1.

Closes #31
Closes #32

…4.1)

#31: a `postgres.indexes` entry without a `name` generated
`CREATE [UNIQUE] INDEX "" ...` -> "zero-length delimited identifier", failing
table creation. Derive a name (`<table>_<cols>_idx`, `_key` for unique,
truncated to 63 chars) when omitted, mirroring Postgres's own default naming.

#32: on any failing statement the pg client was released twice (query/client
error handler + the finally block), so pg-pool's throwOnDoubleRelease printed a
confusing "Release called on client which has already been released" ahead of
the real error. Release exactly once via a guard.

Tests: unit test for the derived index name (execution_sql_test); integration
tests against real Postgres for the unnamed-index create and for no
double-release noise on a failing statement (postgres.spec). Bumps
SQLANVIL_VERSION 1.4.0 -> 1.4.1.

Closes #31
Closes #32

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ihistand
ihistand merged commit 6c980dd into main Jun 17, 2026
@ihistand
ihistand deleted the fix/postgres-index-name-and-client-release branch June 17, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant