class pq\Types
 implements ArrayAccess

Accessor to the PostgreSQL pg_type relation. See here for an overview.

Example:


<?php

$connection 
= new pq\Connection;
$types = new pq\Types($connection);
foreach (
$types["int2vector"] as $key=>$val) {
    
printf("%-20s = %s\n"$keyis_bool($val) ? ($val?'t':'f') : $val);
}

?>

Yields for a PostgreSQL v9.3 server:


oid                  = 22
typname              = int2vector
typnamespace         = 11
typowner             = 10
typlen               = -1
typbyval             = f
typtype              = b
typcategory          = A
typispreferred       = f
typisdefined         = t
typdelim             = ,
typrelid             = 0
typelem              = 21
typarray             = 1006
typinput             = int2vectorin
typoutput            = int2vectorout
typreceive           = int2vectorrecv
typsend              = int2vectorsend
typmodin             = -
typmodout            = -
typanalyze           = -
typalign             = i
typstorage           = p
typnotnull           = f
typbasetype          = 0
typtypmod            = -1
typndims             = 0
typcollation         = 0
typdefaultbin        = 
typdefault           = 
typacl               = 

NOTE:
The following OID constants are obtained from the postgres server headers at build time and differ between major versions. Dynamic type information, f.e. from extensions or the actual version of the postgres connected to, can be accessed through the ArrayAccess interface of pq\Types.

Constants:

Properties:

Functions: