All skills
planetscale avatar

/postgres

@2b8cda6 official

PostgreSQL best practices, query optimization, connection troubleshooting, and performance improvement. Load when working with Postgres databases.

Use this Skill: https://skilld.dev/gh/planetscale/database-skills/postgres

This session only. Nothing lands on disk.

referencesps-connections.md

≈404 tokens on demand. Your agent reads this file only when SKILL.md points to it.

PlanetScale Postgres Connections

Postgres docs: https://planetscale.com/docs/postgres/connecting

Protocol Standard Port Pooled Port SSL
Postgres 5432 6432 (PgBouncer) Required

Credentials (roles) are branch-specific and cannot be recovered after creation.

Connection String

postgresql://<user>:<password>@<host>.horizon.psdb.cloud:5432/<database>?sslmode=verify-full&sslrootcert=system&sslnegotiation=direct

Use port 6432 for PgBouncer (applications/OLTP). Use port 5432 for DDL, admin tasks, and migrations.

Troubleshooting

Error Fix
password authentication failed Check role format: <role>.<branch_id>
too many clients already Use PgBouncer (port 6432)
SSL connection is required Add sslmode=verify-full&sslrootcert=system

Best practices:

  • Use the PlanetScale Postgres metrics page to monitor direct and PgBouncer connections
  • Route OLTP traffic to port 6432 and reserve 5432 for admin/migrations.
  • Run maintenance that changes session state (e.g. SET default_transaction_read_only) on port 5432 only. On 6432 (PgBouncer transaction pooling) session SETs leak into other clients' connections.
  • Avoid raising max_connections reactively instead of pooling.

Source: SKILL.md on GitHub

1 alert17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides comprehensive documentation, best practices, and diagnostic SQL queries for PostgreSQL and PlanetScale-specific features. No security issues were identified.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer6mo

    18/23 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 2b8cda6. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Activeupdated 7 months ago
metadata
{
  "author": "planetscale",
  "version": "1.0.0"
}
  • Database
  • postgres
  • schema-design
  • indexing
  • query-optimization
  • replication
  • monitoring
  • backup-recovery
  • planetscale

README badge

README badge for planetscale/database-skills/postgres

Provides Postgres best practices, query optimization guidance, indexing strategies, and schema design patterns. Includes PlanetScale-specific connection pooling, monitoring, and CLI reference for hosted Postgres deployments.

Generated from the current SKILL.md.

Does this skill cover PlanetScale-specific features like connection pooling?
Yes. The skill includes references for PlanetScale connection pooling, PgBouncer configuration, the pscale CLI, and PlanetScale Insights for slow query analysis.
What topics does this skill cover?
Schema design, indexing, query optimization, partitioning, MVCC and transactions, replication, WAL operations, monitoring, backup/recovery, and PlanetScale-specific connection and deployment workflows.
Does this skill help with query performance troubleshooting?
Yes. It includes guidance on query patterns, index optimization, MVCC transaction isolation, and monitoring via pg_stat views and pg_stat_statements.
Can I use this skill if I self-host Postgres instead of PlanetScale?
Yes. The skill covers generic Postgres best practices and operations. PlanetScale-specific references are optional and only used if you choose PlanetScale for hosting.

Generated from the current SKILL.md. These answers refresh after source changes.