> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW SAVEPOINT STATUS

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

The `SHOW SAVEPOINT STATUS` <InternalLink path="sql-statements">statement</InternalLink> lists the active <InternalLink path="savepoint">savepoints</InternalLink> in the current <InternalLink path="transactions">transaction</InternalLink>.

## Required privileges

No <InternalLink path="security-reference/authorization#managing-privileges">privileges</InternalLink> are required to create or show a savepoint. However, privileges are required for each statement within a transaction.

## Synopsis

<img src="https://mintcdn.com/cockroachlabs/gtjMfbHiKZTUwAsm/images/sql-diagrams/v25.2/show_savepoint_status.svg?fit=max&auto=format&n=gtjMfbHiKZTUwAsm&q=85&s=5f79acf7ef87785a9b8b72cf153b1f53" alt="show_savepoint_status syntax diagram" style={{maxWidth: "100%", overflowX: "auto"}} width="335" height="37" data-path="images/sql-diagrams/v25.2/show_savepoint_status.svg" />

<img src="https://mintcdn.com/cockroachlabs/5ggzXbKjhIPUGwvF/images/generated/docs/v25.2/show-savepoint-status/syntax-diagram-850e24556552.svg?fit=max&auto=format&n=5ggzXbKjhIPUGwvF&q=85&s=19e7f1e00ce840ec54dc76aa2e1920fe" alt="SQL syntax diagram" width="335" height="37" data-path="images/generated/docs/v25.2/show-savepoint-status/syntax-diagram-850e24556552.svg" />

## Response

The following fields are returned for each savepoint.

| Field                    | Description                                                          |
| ------------------------ | -------------------------------------------------------------------- |
| `savepoint\_name`        | The name of the savepoint.                                           |
| `is\_initial\_savepoint` | Whether the savepoint is the outermost savepoint in the transaction. |

## Example

1. Open a <InternalLink path="transactions">transaction</InternalLink> using <InternalLink path="begin-transaction">`BEGIN`</InternalLink>, and create a <InternalLink path="transactions#nested-transactions">nested transaction</InternalLink> using a <InternalLink path="savepoint">savepoint</InternalLink>:

   ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
   > BEGIN;
   SAVEPOINT foo;
   ```
2. Use the `SHOW SAVEPOINT STATUS` statement to list the active savepoints in the current nested transaction.

   ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
   > SHOW SAVEPOINT STATUS;
   ```

   ```text theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
     savepoint_name | is_initial_savepoint
   -----------------+-----------------------
     foo            |        true
   (1 row)
   ```

   Currently, there is only one savepoint.
3. Commit this nested transaction by issuing the <InternalLink path="release-savepoint">`RELEASE SAVEPOINT`</InternalLink> statement, then clear the connection for the next transaction by issuing a <InternalLink path="commit-transaction">`COMMIT`</InternalLink> statement:

   ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
   > RELEASE SAVEPOINT foo;
   COMMIT;
   ```

   If we did not want to commit this nested transaction, but restart it instead, we would have issued a <InternalLink path="rollback-transaction#rollback-a-nested-transaction">`ROLLBACK TO SAVEPOINT`</InternalLink>.

## See also

* <InternalLink path="savepoint">`SAVEPOINT`</InternalLink>
* <InternalLink path="release-savepoint">`RELEASE SAVEPOINT`</InternalLink>
* <InternalLink path="rollback-transaction">`ROLLBACK`</InternalLink>
* <InternalLink path="begin-transaction">`BEGIN`</InternalLink>
* <InternalLink path="commit-transaction">`COMMIT`</InternalLink>
* <InternalLink path="transactions">Transactions</InternalLink>
