About PGAdapter

This page provides an overview of PGAdapter. To learn how to start PGAdapter, see Starting PGAdapter.

PGAdapter is a sidecar proxy that supports the Cloud Spanner PostgreSQL interface. It runs on the same machine as the application and exposes an endpoint on localhost that supports the PostgreSQL wire protocol. It translates the PostgreSQL wire protocol into the Cloud Spanner wire protocol, gRPC. With this proxy running locally, a PostgreSQL client such as psql can connect to a Cloud Spanner database.

The following diagram shows how psql connects to Cloud Spanner through PGAdapter.

psql connects to Cloud Spanner through PGAdapter

PGAdapter supports simple and extended query modes, and supports any data type that the Cloud Spanner PostgreSQL interface supports.

PGAdapter execution environments

You can run PGAdapter by using one of the following methods:

  • Standalone. PGAdapter is supplied as a JAR file and runs standalone in the JVM.
  • Containerized. PGAdapter is also packaged as a Docker image.
  • In-process. Your Java application code can use the supplied JAR file to create and start a PGAdapter instance.

For details about these methods, see Starting PGAdapter.

PGAdapter limitations

The following PostgreSQL wire protocol features are not supported:

  • COPY protocol
  • SSL (The gRPC wire protocol encrypts by default.)