# PlanetScale: Postgres

> PlanetScale is a relational database platform for Vitess, Neki, and Postgres that gives you scale, performance, and reliability without sacrificing developer experience.

## Postgres

### Onboarding

- [PlanetScale Postgres](https://planetscale.com/docs/postgres.md)

#### Getting started

- [PlanetScale Postgres quickstart](https://planetscale.com/docs/postgres/tutorials/planetscale-postgres-quickstart.md): This guide will walk you through how to create a new PlanetScale Postgres database.
- [Day one with PlanetScale Postgres](https://planetscale.com/docs/postgres/day-one-with-planetscale-postgres.md): Top ten things you should be aware of to kill your p99, lower your egress, and get your application flying.
- [PlanetScale Postgres database dashboard](https://planetscale.com/docs/postgres/dashboard.md): When you navigate to a database in your PlanetScale organization, you'll see a comprehensive view of your cluster health, performance metrics, and management options. You can filter this view by [branch](/docs/postgres/branching) by selecting from the branch dropdown at the top.
- [Web console](https://planetscale.com/docs/postgres/web-console.md): Interactive interface for running PostgreSQL queries and DDL against PlanetScale Postgres database branches.
- [PlanetScale Postgres architecture](https://planetscale.com/docs/postgres/postgres-architecture.md): PlanetScale Postgres is a managed PostgreSQL service built on modern cloud infrastructure.
- [Postgres compatibility](https://planetscale.com/docs/postgres/postgres-compatibility.md): PlanetScale Postgres is built on standard PostgreSQL, providing full compatibility with PostgreSQL features. This page documents the specific behaviors, limitations, and differences you should be aware of when using PlanetScale Postgres.
- [PlanetScale Postgres operations philosophy](https://planetscale.com/docs/postgres/operations-philosophy.md): PlanetScale has a high standard for uptime and availability of Postgres databases.
- [Connection resilience guide](https://planetscale.com/docs/postgres/connection-resilience.md): Configure PlanetScale Postgres for maximum availability in demanding OLTP workloads.

### Platform

- [PlanetScale Postgres pricing](https://planetscale.com/docs/postgres/pricing.md): PlanetScale Postgres databases are billed based on their configuration and usage.

#### Configuration

- [Cluster configuration](https://planetscale.com/docs/postgres/cluster-configuration.md)
- [CPU Architectures](https://planetscale.com/docs/postgres/cluster-configuration/cpu-architectures.md): When deploying PostgreSQL databases, choosing the right CPU architecture is crucial for optimizing performance, cost, and efficiency. PlanetScale Postgres supports both x86-64 and ARM64 (aarch64) architectures, with ARM64 instances powered by AWS Graviton processors.
- [Cluster storage configuration](https://planetscale.com/docs/postgres/cluster-configuration/cluster-storage.md): You can configure storage settings for network-attached storage PlanetScale Postgres clusters in the "**Storage**" tab on the Clusters page for your database.
- [Maintenance windows](https://planetscale.com/docs/postgres/cluster-configuration/maintenance-windows.md): Maintenance windows have been temporarily disabled for PlanetScale Postgres databases.
- [Cluster configuration parameters](https://planetscale.com/docs/postgres/cluster-configuration/parameters.md): You can configure your PlanetScale Postgres cluster settings in the "**Parameters**" tab on the Clusters page for your database.
- [Disk autoscaling](https://planetscale.com/docs/postgres/cluster-configuration/disk-autoscaling.md): Disk autoscaling automatically increases storage when your database approaches a disk size utilization threshold, preventing storage-related outages without manual intervention. You can also manually shrink your disk allocation.
- [Single node](https://planetscale.com/docs/postgres/cluster-configuration/single-node.md): Single node Postgres databases come with a single primary and no replicas, and are a great cost-effective option for development or production workloads that do not require high availability.
- [Supported versions](https://planetscale.com/docs/postgres/cluster-configuration/versions.md): When creating a PlanetScale Postgres cluster, you can choose from any of the Postgres versions we support.
- [Cluster updates](https://planetscale.com/docs/postgres/cluster-configuration/updates.md): PlanetScale occasionally releases software updates for your Postgres cluster.
- [Settings](https://planetscale.com/docs/postgres/settings.md): The Settings page allows you to configure general settings and options for your PlanetScale Postgres database.

#### Extensions

- [Extensions](https://planetscale.com/docs/postgres/extensions.md): PostgreSQL extensions are add-on modules that extend the functionality of your database beyond the core features. They provide additional data types, functions, operators, indexes, and other capabilities without requiring modifications to the PostgreSQL source code.
- [Extensions: auto_explain](https://planetscale.com/docs/postgres/extensions/auto_explain.md): auto_explain logs execution plans for slow statements automatically to help troubleshoot query performance.
- [Extensions: pg_cron](https://planetscale.com/docs/postgres/extensions/pg_cron.md): pg_cron is a simple cron-based job scheduler for PostgreSQL. It allows you to run SQL commands on a schedule, similar to how cron jobs work in Unix-like systems.
- [Extensions: pg_hint_plan](https://planetscale.com/docs/postgres/extensions/pg_hint_plan.md): The pg_hint_plan extension allows you to influence the query planner's decisions by providing hints. It can be used to optimize query performance by guiding the planner towards more efficient execution plans.
- [Extensions: pg_partman_bgw](https://planetscale.com/docs/postgres/extensions/pg_partman_bgw.md): The pg_partman_bgw extension is a background worker for managing partitioned tables in PostgreSQL. It automates the creation and maintenance of partitioned tables, making it easier to manage large datasets.
- [Extensions: pg_squeeze](https://planetscale.com/docs/postgres/extensions/pg_squeeze.md): pg_squeeze automatically cleans up unused space in tables (table bloat). pg_squeeze helps maintain optimal table performance by removing dead space that accumulates over time from UPDATE and DELETE operations.
- [Extensions: pg_stat_statements](https://planetscale.com/docs/postgres/extensions/pg_stat_statements.md): pg_stat_statements is a PostgreSQL extension that tracks execution statistics of all SQL statements executed by a server. It provides insights into query performance, allowing you to identify slow queries and optimize them
- [Extensions: pg_strict](https://planetscale.com/docs/postgres/extensions/pg_strict.md): pg_strict blocks dangerous queries before they run. It prevents common mistakes like UPDATE or DELETE statements without WHERE clauses that would affect every row in a table.
- [Extensions: pginsights](https://planetscale.com/docs/postgres/extensions/pginsights.md): The pginsights extension is a PlanetScale Insights plugin that provides query performance monitoring and analysis capabilities. This extension is always enabled for PlanetScale databases and integrates with the Query Insights feature.
- [Extensions: pg_duckdb](https://planetscale.com/docs/postgres/extensions/pg_duckdb.md): pg_duckdb is a Postgres extension that embeds DuckDB, a high-performance analytical database, directly into Postgres.
- [Extensions: pgvector](https://planetscale.com/docs/postgres/extensions/pgvector.md): Open-source vector similarity search for Postgres, Store embeddings and run nearest-neighbor queries
- [Extensions: TimescaleDB](https://planetscale.com/docs/postgres/extensions/timescaledb.md): TimescaleDB is a time-series database for high-performance real-time analytics packaged as a Postgres extension.

#### Connecting

- [Connections overview](https://planetscale.com/docs/postgres/connecting.md): There are several ways to connect to Postgres databases, each with their advantages and tradeoffs.
- [Connections quickstart](https://planetscale.com/docs/postgres/connecting/quickstart.md): PlanetScale Postgres works with any standard PostgreSQL driver or library that supports SSL connections.
- [Managing Roles for your Postgres database](https://planetscale.com/docs/postgres/connecting/roles.md): When you connect to your database, you have the option to connect with the default role or a user-generated role. This document covers the differences between each option and how to create new roles.
- [PgBouncer](https://planetscale.com/docs/postgres/connecting/pgbouncer.md): PgBouncer provides connection pooling for your Postgres database.
- [PostgreSQL Proxy - Client Error Reference](https://planetscale.com/docs/postgres/connecting/client-error-reference.md): This document provides a comprehensive reference of all error messages that the Exosphere PostgreSQL proxy may send to clients. These errors follow the PostgreSQL wire protocol format and include standard SQLSTATE error codes.
- [Using the Neon serverless driver](https://planetscale.com/docs/postgres/connecting/neon-serverless-driver.md)
- [IP restrictions](https://planetscale.com/docs/postgres/connecting/ip-restrictions.md): Manage which IP addresses can establish connections to your database.
- [Self-improving database](https://planetscale.com/docs/self-improving-database.md): Use the PlanetScale MCP server with AI coding agents to continuously optimize database performance based on production Insights data and Schema Recommendations
- [PlanetScale Terraform provider](https://planetscale.com/docs/terraform.md): A resource model for Vitess, Neki, and Postgres databases, designed for Terraform and OpenTofu.

##### MCP

- [PlanetScale Model Context Protocol (MCP)](https://planetscale.com/docs/mcp-server.md): Connect Claude, Cursor, Notion, and other MCP-compatible tools to your PlanetScale databases and Insights
- [Authenticate the MCP server with a service token](https://planetscale.com/docs/mcp/service-token.md): Use a PlanetScale service token to authenticate the hosted MCP server in CI, headless agents, and clients that send a custom HTTP header

##### Private connections

- [Connect privately with AWS PrivateLink](https://planetscale.com/docs/postgres/connecting/private-connections/aws-privatelink.md): When you use AWS PrivateLink, your network traffic between your VPC and PlanetScale stays within the AWS network, without traversing the public internet.
- [Connect privately with GCP Private Service Connect](https://planetscale.com/docs/postgres/connecting/private-connections/gcp-private-service-connect.md): When you use GCP Private Service Connect, your network traffic between your VPC and PlanetScale stays within the Google Cloud network, without traversing the public internet.

#### Imports

- [Postgres Imports](https://planetscale.com/docs/postgres/imports/postgres-imports.md): For customers looking to migrate their Postgres databases to PlanetScale Postgres, you have several options for how to make this the smoothest event for your business.
- [Discovery Tool](https://planetscale.com/docs/postgres/imports/discovery-tool.md): Assess your PostgreSQL database and cloud infrastructure before migrating to PlanetScale Postgres.
- [Postgres Imports - Cloudflare D1](https://planetscale.com/docs/postgres/imports/postgres-migrate-d1.md): Migrate a Cloudflare D1 (SQLite) database to PlanetScale Postgres using wrangler and pscale import d1.
- [Postgres Imports - PGDump and Restore](https://planetscale.com/docs/postgres/imports/postgres-migrate-dumprestore.md)
- [Postgres Imports - WAL Streaming](https://planetscale.com/docs/postgres/imports/postgres-migrate-walstream.md)
- [Postgres Imports - pgcopydb](https://planetscale.com/docs/postgres/imports/postgres-migrate-pgcopydb.md): Migrate your PostgreSQL database to PlanetScale Postgres using pgcopydb with near-zero downtime through parallel data copying and change data capture.
- [Postgres Imports - Amazon DMS](https://planetscale.com/docs/postgres/imports/postgres-migrate-dms.md)
- [Import public IP addresses](https://planetscale.com/docs/postgres/imports/import-ips.md): When importing a database, you may have IP restrictions in place on your source database and may need to grant a set of IP addresses access to your Postgres database so that PlanetScale can make the connection.

##### Provider-specific guides

- [Migrate from Supabase to PlanetScale](https://planetscale.com/docs/postgres/imports/supabase.md): Use this guide to migrate an existing Supabase database to PlanetScale Postgres.
- [Migrate from Neon to PlanetScale](https://planetscale.com/docs/postgres/imports/neon.md): Use this guide to migrate an existing Neon database to PlanetScale Postgres.
- [Migrate from Heroku to PlanetScale](https://planetscale.com/docs/postgres/imports/heroku.md): Migrate from Heroku Postgres to PlanetScale with minimal downtime using the Heroku Migrator tool.
- [Migrate from Aurora to PlanetScale](https://planetscale.com/docs/postgres/imports/aurora.md): Use this guide to migrate an existing Aurora (Postgres) database to PlanetScale Postgres.
- [Migrate from Aurora using Amazon DMS with CloudFormation](https://planetscale.com/docs/postgres/imports/aurora-dms.md): This method uses Infrastructure as Code with Step Functions workflow automation for a completely managed migration experience.

#### Branching

- [Branching](https://planetscale.com/docs/postgres/branching.md): Branches on PlanetScale Postgres are isolated database deployments that provide you with separate environments for development and testing, as well as restoring from backups.
- [Development Environments](https://planetscale.com/docs/postgres/development-environments.md): When using development environments, it's important to have a way to work with your database and test schema changes in isolation from production. We have several recommendations for how to accomplish this when using PlanetScale Postgres.

#### Integrations

- [PlanetScale GitHub Actions](https://planetscale.com/docs/postgres/integrations/github-actions.md)
- [Logical replication and Change Data Capture (CDC)](https://planetscale.com/docs/postgres/integrations/logical-cdc.md): Change Data Capture (CDC) allows you to track and stream data changes from your PostgreSQL database to external systems in real-time. PlanetScale Postgres supports logical replication, enabling CDC through various tools and integrations.

#### Monitoring

- [Query Insights](https://planetscale.com/docs/postgres/monitoring/query-insights.md): PlanetScale Insights gives you a detailed look into **all active queries** running against your database.
- [Inspect live Postgres connections](https://planetscale.com/docs/postgres/monitoring/connections.md): Watch live Postgres connection activity, find what is blocking what, and cancel or terminate connections from the PlanetScale CLI.
- [Tags](https://planetscale.com/docs/postgres/monitoring/query-tags.md): Attach key-value metadata to SQL statements to filter performance data in Insights and Database Traffic Control.
- [Cluster Metrics](https://planetscale.com/docs/postgres/monitoring/metrics.md): The Metrics dashboard provides comprehensive monitoring and observability for your PostgreSQL database cluster.
- [Cluster Logs](https://planetscale.com/docs/postgres/monitoring/logs.md): The Logs dashboard provides comprehensive logging and debugging capabilities for your PlanetScale Postgres database cluster. This centralized view helps you monitor database activity, troubleshoot issues, and analyze system behavior in real-time.
- [Authentication attempts](https://planetscale.com/docs/postgres/monitoring/authentication-attempts.md): Export a report of every attempt to authenticate against your Postgres databases, including the real client IP, the credential used, and whether access was allowed or denied.
- [Anomalies](https://planetscale.com/docs/postgres/monitoring/anomalies.md): Anomalies are defined as periods with a substantially elevated percentage of slow-running queries.
- [Errors](https://planetscale.com/docs/postgres/monitoring/errors.md): The Errors page surfaces any errors that have been captured on your database in a 24 hour period.
- [Schema recommendations](https://planetscale.com/docs/postgres/monitoring/schema-recommendations.md): With schema recommendations inside of [PlanetScale Insights](/docs/postgres/monitoring/query-insights), you will automatically receive recommendations to improve database performance, reduce memory and storage, and improve your schema.

##### Integrations

- [Prometheus integration for PlanetScale Postgres](https://planetscale.com/docs/postgres/monitoring/prometheus-postgres.md): PlanetScale Postgres exposes Prometheus-compatible metrics endpoints for scraping metrics about your database branches. This, along with our API-driven service discovery, allows you to automatically get in-depth information about all of the Postgres databases in your organization.
- [Prometheus metrics for PlanetScale Postgres](https://planetscale.com/docs/postgres/monitoring/prometheus-metrics-postgres.md): PlanetScale Postgres exposes a Prometheus-compatible endpoint per-branch that allows you to scrape metrics for your database.
- [Sending Prometheus Metrics to Datadog for PlanetScale Postgres](https://planetscale.com/docs/postgres/monitoring/prometheus-metrics-datadog-postgres.md): If you're looking for more metrics than PlanetScale's native Datadog integration provides, this tutorial will show how to configure your [Datadog agent](https://docs.datadoghq.com/agent/) to scrape PlanetScale's [Prometheus infrastructure](/docs/vitess/integrations/prometheus-metrics) automatically,…
- [pganalyze collector](https://planetscale.com/docs/postgres/monitoring/pganalyze.md): Set up pganalyze monitoring on your PlanetScale Postgres databases for query analysis, performance insights, log collection, and alerting through the pganalyze platform.

#### Troubleshooting

- [Read-only mode](https://planetscale.com/docs/postgres/troubleshooting/read-only-mode.md): PlanetScale may automatically enable read-only mode on a cluster to maintain stability and availability when certain conditions are detected.
- [Out of memory (OOM)](https://planetscale.com/docs/postgres/troubleshooting/out-of-memory.md): Understanding and resolving out of memory events on PlanetScale Postgres clusters.
- [Switchovers](https://planetscale.com/docs/postgres/troubleshooting/switchovers.md): Move the primary of a Postgres branch to a replica on demand.

#### Backups

- [Back up and restore](https://planetscale.com/docs/postgres/backups.md): PlanetScale Postgres databases include comprehensive backup and restore capabilities to protect your data. The backup system provides both automated scheduled backups and manual on-demand backups, as well as [point-in-time recovery (PITR)](/docs/postgres/backups/point-in-time-recovery) support throu…
- [Point-in-time recovery](https://planetscale.com/docs/postgres/backups/point-in-time-recovery.md): Point-in-time recovery (PITR) allows you to restore your PlanetScale Postgres database to any specific moment within your backup retention window. Unlike traditional backups that restore to specific backup snapshots, PITR gives you precise control over when to restore your data.

#### Scaling

- [Database replicas](https://planetscale.com/docs/postgres/scaling/replicas.md): A replica is a continuously updated copy of your Postgres database.
- [Horizontal sharding for Postgres](https://planetscale.com/docs/postgres/sharding.md): Scale past a single Postgres primary with Neki

#### Database Traffic Control™

- [Database Traffic Control](https://planetscale.com/docs/postgres/traffic-control.md): Define and enforce limits on how many resources specific operations can use.
- [Concepts](https://planetscale.com/docs/postgres/traffic-control/concepts.md): Terminology and core concepts: resource budgets, rules, limits, and modes.
- [Getting started](https://planetscale.com/docs/postgres/traffic-control/getting-started.md): Adopt Database Traffic Control gradually. Start with ample limits, observe real behavior, and then tighten.
- [Examples and recipes](https://planetscale.com/docs/postgres/traffic-control/examples-and-recipes.md): Scenarios to help you design effective resource budgets.
- [FAQ and troubleshooting](https://planetscale.com/docs/postgres/traffic-control/faq-and-troubleshooting.md): Common questions and troubleshooting help.

### Guides

- [PlanetScale Postgres with Drizzle](https://planetscale.com/docs/postgres/tutorials/planetscale-postgres-drizzle.md): Create a new Postgres database and integrate it with Drizzle.
- [PlanetScale Postgres with Kysely](https://planetscale.com/docs/postgres/tutorials/planetscale-postgres-kysely.md): Create a new Postgres database and integrate it with Kysely.
- [PlanetScale Postgres with Prisma](https://planetscale.com/docs/postgres/tutorials/planetscale-postgres-prisma.md): Create a new Postgres database and integrate it with Prisma.
- [PlanetScale Postgres with Laravel](https://planetscale.com/docs/postgres/tutorials/planetscale-postgres-laravel.md): Create a new Postgres database and integrate it with Laravel.
- [PlanetScale Postgres with Ruby on Rails](https://planetscale.com/docs/postgres/tutorials/planetscale-postgres-rails.md): Create a new Postgres database and integrate it with Ruby on Rails.
- [PlanetScale Postgres with Cloudflare Workers](https://planetscale.com/docs/postgres/tutorials/planetscale-postgres-cloudflare-workers.md): Create a new Postgres database and integrate it with Cloudflare Workers and Hyperdrive.
- [PlanetScale Postgres with Bun](https://planetscale.com/docs/postgres/tutorials/planetscale-postgres-bun.md): Create a new Postgres database and integrate it with Bun.
- [PlanetScale Postgres with Node.js](https://planetscale.com/docs/postgres/tutorials/planetscale-postgres-node.md): Create a new Postgres database and integrate it with Node.js.
