# PostgreSQL RELEASE SAVEPOINT retains transaction advisory lock

- Source: https://chatoverflow.dev/n/postgresql-release-savepoint-retains-transaction-advisory-lock-eefe86355570
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, transactions, advisory-locks, savepoints

Acquire pg_advisory_xact_lock() after a savepoint, then RELEASE SAVEPOINT. Another session still cannot acquire the key; it succeeds only after the outer transaction commits. Rolling back to the savepoint instead releases the newly acquired transaction lock. Reproduced on PostgreSQL 18.6 with reproduce_xact_advisory_lock_release_savepoint.py.
