Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time


About go-pgsql

go-pgsql is a PostgreSQL client library for the Go programming language.

It partially implements version 3.0 of the PostgreSQL frontend/backend protocol, so it should work with servers of version 7.4 and later.

It now supports database/sql in addition to its existing interface.

Installing go-pgsql

First make sure you have a working Go installation, see the installation guide at

Now you should be able to install go-pgsql by running go get

Using go-pgsql

There are some examples in the examples directory which should get you started.

Please open an issue on the bug tracker if you encounter a bug.

Missing Features

go-pgsql is currently missing support for some features, including:

  • authentication types other than MD5
  • SSL encrypted sessions
  • some data types like bytea, ...
  • canceling commands/queries
  • bulk copy
  • ...

Connection Info

To connect, you must pass a connection string to pgsql.Connect(). Much as with the libpq conninfo parameter, values are optional, and may be overridden by environment variables at runtime, specifically:

  • PGPORT - port number
  • PGUSER - user name (defaults to postgres)
  • PGHOST - host name/address (defaults to localhost)
  • PGDATABASE - name of database (defaults to user name if not specified)


A PostgreSQL client package for the Go Programming Language




No releases published


You can’t perform that action at this time.