ArrayAccess
Accessor to the PostgreSQL pg_type
relation.
See here for an overview.
<?php
$connection = new pq\Connection;
$types = new pq\Types($connection);
foreach ($types["int2vector"] as $key=>$val) {
printf("%-20s = %s\n", $key, is_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 theArrayAccess
interface of pq\Types.
BOOL
bool
type.bytea
type.char
type.name
type.int8
type.int2
type.int2vector
type.int4
type.regproc
type.text
type.oid
type.tid
type.xid
type.cid
type.oidvector
type.pg_type
type.pg_attribute
type.pg_proc
type.pg_class
type.json
type.xml
type.xmlarray
type.jsonarray
type.pg_node_tree
type.smgr
type.point
type.lseg
type.path
type.box
type.polygon
type.line
type.linearray
type.float4
type.float8
type.unknown
type.circle
type.circlearray
type.money
type.moneyarray
type.macaddr
type.inet
type.cidr
type.boolarray
type.byteaarray
type.chararray
type.namearray
type.int2array
type.int2vectorarray
type.int4array
type.regprocarray
type.textarray
type.oidarray
type.tidarray
type.xidarray
type.cidarray
type.oidvectorarray
type.bpchararray
type.varchararray
type.int8array
type.pointarray
type.lsegarray
type.patharray
type.boxarray
type.float4array
type.float8array
type.polygonarray
type.aclitem
type.aclitemarray
type.macaddrarray
type.inetarray
type.cidrarray
type.cstringarray
type.bpchar
type.varchar
type.date
type.time
type.timestamp
type.timestamparray
type.datearray
type.timearray
type.timestamptz
type.timestamptzarray
type.interval
type.intervalarray
type.numericarray
type.timetz
type.timetzarray
type.bit
type.bitarray
type.varbit
type.varbitarray
type.numeric
type.refcursor
type.refcursorarray
type.regprocedure
type.regoper
type.regoperator
type.regclass
type.regtype
type.regprocedurearray
type.regoperarray
type.regoperatorarray
type.regclassarray
type.regtypearray
type.uuid
type.uuidarray
type.tsvector
type.gtsvector
type.tsquery
type.regconfig
type.regdictionary
type.tsvectorarray
type.gtsvectorarray
type.tsqueryarray
type.regconfigarray
type.regdictionaryarray
type.txid_snapshot
type.txid_snapshotarray
type.int4range
type.int4rangearray
type.numrange
type.numrangearray
type.tsrange
type.tsrangearray
type.tstzrange
type.tstzrangearray
type.daterange
type.daterangearray
type.int8range
type.int8rangearray
type.record
type.cstring
type.any
type.anyarray
type.void
type.trigger
type.event_trigger
type.language_handler
type.internal
type.opaque
type.anyelement
type.anynonarray
type.anyenum
type.fdw_handler
type.anyrange
type.Create a new instance populated with information obtained from the pg_type
relation.
void
pq\Types::__construct(pq\Connection $conn[, array
$namespaces = NULL
)
Refresh type information from pg_type
.
void
pq\Types::refresh([array
$namespaces = NULL
])