Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package postgres is the PostgreSQL provider: New constructs the pool over pgx's database/sql adapter from a finalized database.Config, without I/O. Port defaults to 5432, a host starting with "/" is a Unix-socket directory, and the password is set on the parsed config, never in the connection URL. An empty User falls back to the OS username. Every connection returns timestamptz values in time.UTC, whatever time.Local or the session's TimeZone is; timestamp values, which carry no zone, come back in time.UTC too. The provider supplies no dialect; the sqlate/postgres package does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg database.Config) (*database.DB, error)

New constructs the connection pool from a finalized config and wraps it with database.New, without I/O. An unfinalized config panics; a reserved option or a config pgx cannot parse is an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL