RELEASE_SAVEPOINT(7pg15)

πŸ“¦ version 15.19, in opensuse-leap 16.0

πŸ’– RELEASE_SAVEPOINT πŸ’–

okay bestie, this is the RELEASE SAVEPOINT(7) page from the PostgreSQL 15.19 Documentation, and it’s genuinely giving β€œtiny command, big cleanup energy.” 🧹✨


🌸 NAME 🌸

RELEASE_SAVEPOINT β€” destroy a previously defined savepoint. periodt. πŸ’…


✨ SYNOPSIS ✨

RELEASE [ SAVEPOINT ] savepoint_name

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so RELEASE SAVEPOINT destroys a savepoint previously defined in the current transaction. it’s literally the β€œbye, savepoint” button. πŸ‘‹

destroying a savepoint makes it unavailable as a rollback point, but it has no other user visible behavior. no extra drama, no surprise rewinds. πŸ™ˆ

it does not undo the effects of commands executed after the savepoint was established. if that’s what you want, go see ROLLBACK TO SAVEPOINT (ROLLBACK_TO_SAVEPOINT(7)). πŸ”

destroying a savepoint when it is no longer needed allows the system to reclaim some resources earlier than transaction end. resource cleanup slay. 🧚

RELEASE SAVEPOINT also destroys all savepoints that were established after the named savepoint was established. it’s giving β€œand everyone after you, goodbye.” πŸ’€


πŸŽ€ PARAMETERS πŸŽ€

  • savepoint_name β€” the name of the savepoint to destroy. cute name, permanent goodbye. πŸ’–

⭐ NOTES ⭐

  • specifying a savepoint name that was not previously defined is an error. not the vibe. 🚨
  • it is not possible to release a savepoint when the transaction is in an aborted state. hard no. πŸ™…β€β™€οΈ
  • if multiple savepoints have the same name, only the most recently defined unreleased one is released. repeated commands will release progressively older savepoints. so yeah, they queue up like unread messages. 😭

🌈 EXAMPLES 🌈

to establish and later destroy a savepoint, bestie:

BEGIN;
    INSERT INTO table1 VALUES (3);
    SAVEPOINT my_savepoint;
    INSERT INTO table1 VALUES (4);
    RELEASE SAVEPOINT my_savepoint;
COMMIT;

the above transaction will insert both 3 and 4. both! iconic. πŸ”₯


πŸ‘‘ COMPATIBILITY πŸ‘‘

this command conforms to the SQL standard. the standard specifies that the key word SAVEPOINT is mandatory, but PostgreSQL allows it to be omitted. PostgreSQL being flexible? we love to see it. πŸ’…


🫢 SEE ALSO 🫢

go read the whole friend group, iykyk. πŸ“šβœ¨


and that’s the page, bestie 🫢 β€” brought to you by PostgreSQL 15.19, dated 2026, and yes the manual is RELEASE SAVEPOINT(7). no cap, go release those savepoints. πŸ’…πŸŽ€

πŸ“¦ where this page comes from