Skip to content

pg_toolkit_brazil

Brazilian CPF and CNPJ types, validation, formatting, casts, and operators.

pg_toolkit_brazil · Brazilian CPF and CNPJ types, validation, formatting, casts, and operators.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101935pg_toolkit_brazilpg_toolkit_brazil0.1TYPEBSD-3-ClauseC

Usage

Sources:

pg_toolkit_brazil Brazilian CPF and CNPJ types, validation, formatting, casts, and operators.

Enablement

Install the files for the intended server, then create pg_toolkit_brazil in the target database:

CREATE EXTENSION pg_toolkit_brazil;

Core Workflow

The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.

CREATE TABLE pessoa (id bigint GENERATED ALWAYS AS IDENTITY, cpf cpf);
INSERT INTO pessoa (cpf) VALUES (cpf '40100276300');
SELECT id, cpf FROM pessoa;

Main Objects

The reviewed install surface includes these prominent objects:

ObjectKindOperational role
cnpjTYPEUser-facing data type created by the extension.
cnpj_cmpFUNCTIONCallable function from the reviewed install surface.
cnpj_eqFUNCTIONCallable function from the reviewed install surface.
cnpj_geFUNCTIONCallable function from the reviewed install surface.
cnpj_gtFUNCTIONCallable function from the reviewed install surface.
cnpj_leFUNCTIONCallable function from the reviewed install surface.
cnpj_ltFUNCTIONCallable function from the reviewed install surface.
cnpj_neFUNCTIONCallable function from the reviewed install surface.

Operations and Boundaries

  • Catalog lifecycle is abandoned; test upgrades, dump/restore, and server compatibility before production use.

Table reader