RELEASE_SAVEPOINT(7pg14)

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

okay so bestie, you’ve pulled up the RELEASE SAVEPOINT(7) page from the PostgreSQL 14.24 Documentation, and it’s lowkey giving transaction cleanup main character energy. ✨ This one is all about yeeting a savepoint you already made β€” no rollback, no undo, just release. Let’s get into it. πŸ’…

πŸ’– NAME πŸ’–

RELEASE SAVEPOINT β€” destroy a previously defined savepoint. periodt. 🫢

🌸 SYNOPSIS 🌸

RELEASE [ SAVEPOINT ] savepoint_name

✨ DESCRIPTION ✨

RELEASE SAVEPOINT destroys a savepoint previously defined in the current transaction. boom, gone. πŸ’€

Destroying a savepoint makes it unavailable as a rollback point, but it has no other user visible behavior. It does not undo the effects of commands executed after the savepoint was established. (To do that, 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. ✨

RELEASE SAVEPOINT also destroys all savepoints that were established after the named savepoint was established. so it’s a whole cleanup cascade, iykyk. πŸ§ΉπŸ’…

πŸŽ€ PARAMETERS πŸŽ€

  • savepoint_name β€” the name of the savepoint to destroy. that’s the whole assignment, bestie. 🫢

πŸ’œ NOTES πŸ’œ

  • Specifying a savepoint name that was not previously defined is an error. no cap, that’s an error. 😭
  • It is not possible to release a savepoint when the transaction is in an aborted state. not possible, fr fr. πŸ’€
  • If multiple savepoints have the same name, only the most recently defined unreleased one is released. Repeated commands will release progressively older savepoints. so the newest one goes first, then the older ones step up. πŸ‘‘

🌈 EXAMPLES 🌈

To establish and later destroy a savepoint:

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. ate. βœ…

πŸ‘‘ 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. slay for flexibility. πŸ’š

πŸ¦‹ SEE ALSO πŸ¦‹

okay that’s the whole RELEASE SAVEPOINT(7) page, bestie β€” huge mwah to PostgreSQL 14.24 and the 2026 date on this doc. you’re welcome, go release those savepoints responsibly. πŸ’‹πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from