pq is a PostgreSQL driver for Go that implements the standard database/sql interface. It serves as a connection library and protocol implementation that translates application data types into the binary and text formats required by PostgreSQL.
The project provides specialized utilities for high-performance data ingestion using bulk data loading and a dedicated bulk data importer. It also features an implementation for listening to asynchronous server notifications and provides tools for connection load balancing across multiple hosts and ports.
The driver covers a broad surface of database interaction, including parameterized query execution, prepared statements, and type mapping for arrays and timezones. Security is handled through SSL/TLS encryption, GSSAPI authentication, and utilities for escaping SQL identifiers and literals to prevent injection. Additional capabilities include detailed diagnostic error handling and raw protocol communication debugging.