pg_foundation provides data and classes that relate to core PostgreSQL elements, such as exception hierarchy, type implementations, type oid identification, and encoding aliases. The Postgres foundation package provides various utilities for working PostgreSQL: PostgreSQL exception classes and SQL state codes; PostgreSQL types and named oids; a version parser; a pg_config dictionary converter; encoding aliases; a byte codec; "optparse" options for command line client programs; the pgpass file parser; an environment variable collector; and a PQ IRI parser.