pg_cron for scheduled jobs. Facts shared by every engine (limits, snapshots, Insights) are on the Databases overview.
Connect
Copy the connection URL from the database’s page in the dashboard. It has this shape, with thesquarecloud user and the squarecloud database created for you:
.pem under Connection → SSL/TLS certificate and point the client to it:
- Node.js
- Python
- psql
Go clients reject
sslmode=verify-full with this certificate (x509: certificate relies on legacy Common Name field): it names the host only in its Common Name, which Go no longer checks. Use sslmode=verify-ca, which still validates the certificate.Connections
Each database accepts up to 256 simultaneous connections, of which 253 are available to your clients. Past that, new connections fail withremaining connection slots are reserved for roles with the SUPERUSER attribute (or sorry, too many clients already). Create one pool per process at startup and reuse it, sized so that every app, worker and shard together stays under the limit. A new connection per request or per query exhausts the limit quickly. The Insights tab shows who holds the open connections.
Your user and permissions
Thesquarecloud role has LOGIN, CREATEDB, CREATEROLE and BYPASSRLS, and owns the squarecloud database. You can create databases, schemas, roles and grants, and change settings a regular user may change, for a session or as a default:
ALTER SYSTEMand settings reserved to superusers;- server-side
COPY ... TO/FROM 'file'(use\copyinpsql, which reads and writes on your machine); - untrusted languages such as
plpython3u; - logical replication and change data capture tools that need it.
Extensions
Already installed:plpgsql, plus pg_cron and pg_stat_statements in the postgres database.
You can enable these in any of your databases with CREATE EXTENSION, in the database that will use them:
vector (pgvector), pg_trgm, pgcrypto, uuid-ossp, citext, hstore, unaccent, ltree, btree_gin, btree_gist, cube, dict_int, fuzzystrmatch, intarray, isn, lo, seg, tablefunc, tcn, tsm_system_rows, tsm_system_time.
Scheduled jobs with pg_cron
pg_cron lives in the postgres database. Connect to postgres (same URL, ending in /postgres) and schedule the job to run in your database. Schedules are in UTC:
cron.job_run_details is never purged automatically. Schedule a cleanup of your old rows:
Memory and configuration
shared_buffersis 25% of the database’s RAM (at least 128 MB). Changing the RAM restarts the database to apply it.- PostgreSQL relies on the operating system’s file cache for the rest, so the RAM shown in the dashboard climbs and then stays high. That is normal, not a leak.
- A single query can write at most 1 GB of temporary files (sorts, hashes). Past it the query fails with
temporary file size exceeds temp_file_limit: add an index or process the data in batches. - The write-ahead log takes 256 to 512 MB of the database’s storage.
- The server configuration is the same on every database and can’t be changed per database.
Slow queries
Statements that take 100 ms or more are recorded, and the Insights tab lists them with their mean time. For your own analysis, connect to thepostgres database and query pg_stat_statements, and use EXPLAIN ANALYZE on the statement:
Snapshots
A PostgreSQL snapshot holds every database and role of the instance. Besides the general cases, it fails when a database hasALLOW_CONNECTIONS false, or when your own lock (LOCK TABLE, a long ALTER TABLE) blocks it for more than 5 minutes. The export is plain SQL text, so a database close to its 10 GB of storage may not fit in a snapshot.

