Skip to content

Access sessions record SQL queries executed through the PgStack proxy. Each session provides temporary credentials for a project's configured Access role. The returned connection URL can be used with a PostgreSQL client and must be kept private.

The project's Access view in PgStack lists sessions and their events. Select a session to review its details and recorded SQL queries.

Recorded PgStack Access session showing SQL queries and connection details

Terminal window
pgstack access list

The CLI lists your active sessions.

Sessions last up to one hour. Specify a duration when starting a session:

Terminal window
pgstack access start --env production --duration 30m

Add time to an active session:

Terminal window
pgstack access extend <session-slug> --duration 15m

The default extension is 15 minutes. Extensions cannot leave more than one hour remaining. Expired or revoked sessions cannot be extended; start a new session when you need access again.

Terminal window
pgstack access revoke <session-slug> --reason "Investigation complete"

Revocation prevents further use of the session credentials. Existing connections close within one minute. Logging out of the CLI does not revoke sessions; revoke them explicitly when you finish early.