GoogleCloudPlatform / GoogleCloudPlatform/pgadapter
Unable to use psql through PGAdapter + Emulator image
- Dominant language
- Java
- Stars
- 91
- Forks
- 33
- Avg merge
- 3d 57m
- Merged PRs (30d)
- 58
Description
Hello!
I am following the instructions for running the PGAdapter + Emulator image in the [README](https://github.com/GoogleCloudPlatform/pgadapter#emulator), but can't seem to connect to it through psql. I can see the container is running and it doesn't have any error logs.
is there a step I'm missing?
```sh
➜ ~ docker pull gcr.io/cloud-spanner-pg-adapter/pgadapter-emulator
docker run \
-d -p 5432:5432 \
gcr.io/cloud-spanner-pg-adapter/pgadapter-emulator
sleep 2
psql -h localhost -p 5432 -d test-database
Using default tag: latest
latest: Pulling from cloud-spanner-pg-adapter/pgadapter-emulator
Digest: sha256:f78f4a39218bf7b0236189a78523bbd20097ed8a768a252ad80e3ad1aa781ec2
Status: Image is up to date for gcr.io/cloud-spanner-pg-adapter/pgadapter-emulator:latest
gcr.io/cloud-spanner-pg-adapter/pgadapter-emulator:latest
a0a1b0eabd900852dee2bbcf843f792f5f02715d0ce2201df930bf8c066f56fb
psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL: database "test-database" does not exist
```
**Container Logs**
```
java -jar pgadapter.jar -p emulator-project -i test-instance -r autoConfigEmulator=true -c "" -x
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1783374891.297170 16 emulator_main.cc:39] Cloud Spanner Emulator running.
I0000 00:00:1783374891.297184 16 emulator_main.cc:40] Server address: 0.0.0.0:9010
-- Starting PGAdapter version 0.55.1 --
-- PostgreSQL version: 14.1 --
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by org.newsclub.net.unix.NativeLibraryLoader$StandardLibraryCandidate in an unnamed module (file:/home/pgadapter/lib/junixsocket-common-2.10.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
[2026-07-06 21:54:51.425] [INFO] (com.google.cloud.spanner.pgadapter.ProxyServer startServer): Server started on port 5432
2026/07/06 21:54:52 gateway.go:163: Cloud Spanner emulator running.
2026/07/06 21:54:52 gateway.go:164: REST server listening at 0.0.0.0:9020
2026/07/06 21:54:52 gateway.go:165: gRPC server listening at 0.0.0.0:9010
```
Contributor guide
Research direction
Start with the emulator section of the README and reproduce the supplied Docker and psql commands. Check whether the documented startup flow explains database creation or the expected connection target; done means the README provides a verified command that connects successfully or clearly states the required setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, google-cloud, postgresql
- Domain
- databases, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100