Skip to content

fix: escape replica_identity_index with ident()#1080

Open
oniani1 wants to merge 1 commit into
supabase:masterfrom
oniani1:fix/escape-replica-identity-index
Open

fix: escape replica_identity_index with ident()#1080
oniani1 wants to merge 1 commit into
supabase:masterfrom
oniani1:fix/escape-replica-identity-index

Conversation

@oniani1

@oniani1 oniani1 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

tables.update() interpolates replica_identity_index into the REPLICA IDENTITY USING INDEX clause without ident(), unlike every other identifier in the same function. Index names that need quoting produce invalid SQL, and the value reaches the database unescaped. This wraps it with ident(), matching the rest of the function and the packages/pg-meta sibling.

Added a test that updates the replica identity using an index whose name needs quoting. It fails without the change and passes with it.

Closes #1079

In tables.update(), replica_identity_index is interpolated into the
`REPLICA IDENTITY USING INDEX` clause without ident(), while every
other identifier in the same function is escaped. Index names that
need quoting produce invalid SQL, and the value is not safely escaped
before it reaches the database. Wrap it with ident() to match the
surrounding code.
@oniani1 oniani1 requested review from a team, avallete and soedirgo as code owners June 9, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

replica_identity_index is not escaped in tables.update()

1 participant