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

postgres

package
v0.0.0-...-b85c018 Latest Latest
Warning

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

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

Documentation

Overview

Package postgres is the PostgreSQL engine: its spi.Provider, SQL text, introspection probes, table detail, and the blocking PostgreSQL wire broker for the simple and extended query protocols. The broker owns only wire I/O and mechanically applies engine verdicts; authorization remains exclusively in spi.Authorizer. COPY is deferred to a later phase.

Index

Constants

This section is empty.

Variables

View Source
var Queries = sqldb.Queries{
	HashSetupProbe:        hashSetupProbeSQL,
	HashSetupColumns:      1,
	Routines:              routinesSQL,
	SchemaRoutines:        schemaRoutinesSQL,
	SchemaColumns:         schemaColumnsSQL,
	SchemaHash:            schemaHashSQL,
	SchemaHashFromRows:    schemaHashFromRows,
	Engine:                engines.Postgres,
	TargetSettingsProbe:   "SELECT pg_catalog.version()",
	TargetSettingsColumns: 1,
	TargetSettings:        targetSettings,
}

Queries is the SQL the shared database/sql code runs on a PostgreSQL target.

Functions

func OpenPool

func OpenPool(config spi.TargetConfig) (*sql.DB, error)

OpenPool opens a database/sql handle to a Postgres target.

func ProbeNamespace

func ProbeNamespace(ctx context.Context, conn *sql.Conn, _ string, _ *engines.Session) (*pb.CatalogRequest, error)

ProbeNamespace captures the effective search_path.

func ReadCatalog

func ReadCatalog(ctx context.Context, conn *sql.Conn) (string, error)

ReadCatalog returns current_database(); the catalog every fragment and temp column from this connection is stamped with.

Types

type Provider

type Provider struct{}

Provider is PostgreSQL's spi.Provider.

func (Provider) Engine

func (Provider) Engine() *engines.Engine

func (Provider) OpenTarget

func (Provider) OpenTarget(config spi.TargetConfig) (spi.Target, error)

type Server

type Server struct {
	*wire.Server
	// contains filtered or unexported fields
}

Server is the PostgreSQL wire broker: the shared wire.Server lifecycle (accept loop, connection tracking, graceful drain) plus this protocol's per-connection handler and its target DB/enforcement dependencies.

Jump to

Keyboard shortcuts

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