Skip to content

An Access session provides temporary PostgreSQL credentials and records the queries executed through the session for review.

You need a PgStack account, a project with Access configured, and permission to start sessions. Team admins and engineers can create their own sessions.

On macOS or Linux:

Terminal window
curl -fsSL https://pgstack.io/install.sh | bash

The installer downloads a standalone executable, verifies its SHA-256 checksum, and installs it to ~/.local/bin/pgstack. Add that directory to your PATH if needed.

Terminal window
pgstack auth login

Confirm the code from your terminal in the browser. Use pgstack auth login --no-browser to print the sign-in URL instead of opening it automatically.

Select a project by environment:

Terminal window
pgstack access start --env production --duration 30m --read-only --reason "Investigate delayed orders"

Or use a project slug, replacing <project-slug> with your project's slug:

Terminal window
pgstack access start <project-slug> --duration 30m --read-only --reason "Investigate delayed orders"

The CLI returns a temporary PostgreSQL connection URL. The read-only flag guards against accidental writes; choose the project's role and permissions appropriate for your task.

Copy the returned URL into your PostgreSQL client or use it with psql:

Terminal window
psql '<temporary-connection-url>'

Treat the URL as a secret. It grants access for the session's lifetime. PgStack records the SQL queries executed through the session.

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

Review the session in the project's Access view. See session management for expiration, extensions, and revocation behavior.