NAME

DBIO::PostgreSQL::Adapter - PostgreSQL base->native type resolver

VERSION

version 0.900007

DESCRIPTION

Resolves a canonical column of DBIO::Schema::Type -- one of the eight portable base types -- to the PostgreSQL type it is deployed as:

integer    bigint
text       text
char       character(size)       size defaults to 255
boolean    boolean
numeric    numeric, numeric(precision), numeric(precision,scale)
double     double precision
blob       bytea
timestamp  timestamptz, timestamptz(size)

DBIO::PostgreSQL::DDL asks it for every column declared with one of these names, and DBIO::Schema::ModelCompiler for every column of a schema it compiles.

METHODS

to_native

my $type = $adapter->to_native(\%canonical_column);

Returns the PostgreSQL type for a canonical column. A size is written where the type takes a modifier, by the rule of "type_with_modifier" in DBIO::PostgreSQL::Util: the size of a char, the precision of a numeric and its scale beside it, and the size of a timestamp -- its fractional seconds -- when the column carries one. A size on any other base type is not written; none of their native types takes a modifier.

Throws for a base type that is none of the eight.

An optional second argument names the column (table.column); a refused size names it, as in "type_with_modifier" in DBIO::PostgreSQL::Util.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.