Skip to main content
The SHOW SAVEPOINT STATUS lists the active in the current .

Required privileges

No are required to create or show a savepoint. However, privileges are required for each statement within a transaction.

Synopsis

show_savepoint_status syntax diagram

Response

The following fields are returned for each savepoint.
FieldDescription
savepoint_nameThe name of the savepoint.
is_initial_savepointWhether the savepoint is the outermost savepoint in the transaction.

Example

  1. Open a using , and create a using a :
    > BEGIN;
    SAVEPOINT foo;
    
  2. Use the SHOW SAVEPOINT STATUS statement to list the active savepoints in the current nested transaction.
    > SHOW SAVEPOINT STATUS;
    
      savepoint_name | is_initial_savepoint
    -----------------+-----------------------
      foo            |        true
    (1 row)
    
    Currently, there is only one savepoint.
  3. Commit this nested transaction by issuing the statement, then clear the connection for the next transaction by issuing a statement:
    > RELEASE SAVEPOINT foo;
    COMMIT;
    
    If we did not want to commit this nested transaction, but restart it instead, we would have issued a .

See also