typo, parameter and type fixes
[mdref/mdref-pq] / pq / Types.md
1 # class pq\Types implements ArrayAccess
2
3 Accessor to the PostgreSQL `pg_type` relation.
4 See [here for an overview](pq/Types/: Overview).
5
6 ## Example:
7
8 <?php
9
10 $connection = new pq\Connection;
11 $types = new pq\Types($connection);
12 foreach ($types["int2vector"] as $key=>$val) {
13 printf("%-20s = %s\n", $key, is_bool($val) ? ($val?'t':'f') : $val);
14 }
15
16 ?>
17
18 Yields:
19
20 oid = 22
21 typname = int2vector
22 typnamespace = 11
23 typowner = 10
24 typlen = -1
25 typbyval = f
26 typtype = b
27 typcategory = A
28 typispreferred = f
29 typisdefined = t
30 typdelim = ,
31 typrelid = 0
32 typelem = 21
33 typarray = 1006
34 typinput = int2vectorin
35 typoutput = int2vectorout
36 typreceive = int2vectorrecv
37 typsend = int2vectorsend
38 typmodin = -
39 typmodout = -
40 typanalyze = -
41 typalign = i
42 typstorage = p
43 typnotnull = f
44 typbasetype = 0
45 typtypmod = -1
46 typndims = 0
47 typcollation = 0
48 typdefaultbin =
49 typdefault =
50 typacl =
51
52 > ***NOTE:***
53 The following OID constants are obtained from stock PostgreSQL 9.3.5. Types from f.e. extensions can be accessed through the ArrayAccess interface of pq\Types.
54
55 ## Constants:
56
57 * BOOL
58 OID of the `bool` type.
59 * BYTEA
60 OID of the `bytea` type.
61 * CHAR
62 OID of the `char` type.
63 * NAME
64 OID of the `name` type.
65 * INT8
66 OID of the `int8` type.
67 * INT2
68 OID of the `int2` type.
69 * INT2VECTOR
70 OID of the `int2vector` type.
71 * INT4
72 OID of the `int4` type.
73 * REGPROC
74 OID of the `regproc` type.
75 * TEXT
76 OID of the `text` type.
77 * OID
78 OID of the `oid` type.
79 * TID
80 OID of the `tid` type.
81 * XID
82 OID of the `xid` type.
83 * CID
84 OID of the `cid` type.
85 * OIDVECTOR
86 OID of the `oidvector` type.
87 * PG_TYPE
88 OID of the `pg_type` type.
89 * PG_ATTRIBUTE
90 OID of the `pg_attribute` type.
91 * PG_PROC
92 OID of the `pg_proc` type.
93 * PG_CLASS
94 OID of the `pg_class` type.
95 * JSON
96 OID of the `json` type.
97 * XML
98 OID of the `xml` type.
99 * XMLARRAY
100 OID of the `xmlarray` type.
101 * JSONARRAY
102 OID of the `jsonarray` type.
103 * PG_NODE_TREE
104 OID of the `pg_node_tree` type.
105 * SMGR
106 OID of the `smgr` type.
107 * POINT
108 OID of the `point` type.
109 * LSEG
110 OID of the `lseg` type.
111 * PATH
112 OID of the `path` type.
113 * BOX
114 OID of the `box` type.
115 * POLYGON
116 OID of the `polygon` type.
117 * LINE
118 OID of the `line` type.
119 * LINEARRAY
120 OID of the `linearray` type.
121 * FLOAT4
122 OID of the `float4` type.
123 * FLOAT8
124 OID of the `float8` type.
125 * ABSTIME
126 OID of the `abstime` type.
127 * RELTIME
128 OID of the `reltime` type.
129 * TINTERVAL
130 OID of the `tinterval` type.
131 * UNKNOWN
132 OID of the `unknown` type.
133 * CIRCLE
134 OID of the `circle` type.
135 * CIRCLEARRAY
136 OID of the `circlearray` type.
137 * MONEY
138 OID of the `money` type.
139 * MONEYARRAY
140 OID of the `moneyarray` type.
141 * MACADDR
142 OID of the `macaddr` type.
143 * INET
144 OID of the `inet` type.
145 * CIDR
146 OID of the `cidr` type.
147 * BOOLARRAY
148 OID of the `boolarray` type.
149 * BYTEAARRAY
150 OID of the `byteaarray` type.
151 * CHARARRAY
152 OID of the `chararray` type.
153 * NAMEARRAY
154 OID of the `namearray` type.
155 * INT2ARRAY
156 OID of the `int2array` type.
157 * INT2VECTORARRAY
158 OID of the `int2vectorarray` type.
159 * INT4ARRAY
160 OID of the `int4array` type.
161 * REGPROCARRAY
162 OID of the `regprocarray` type.
163 * TEXTARRAY
164 OID of the `textarray` type.
165 * OIDARRAY
166 OID of the `oidarray` type.
167 * TIDARRAY
168 OID of the `tidarray` type.
169 * XIDARRAY
170 OID of the `xidarray` type.
171 * CIDARRAY
172 OID of the `cidarray` type.
173 * OIDVECTORARRAY
174 OID of the `oidvectorarray` type.
175 * BPCHARARRAY
176 OID of the `bpchararray` type.
177 * VARCHARARRAY
178 OID of the `varchararray` type.
179 * INT8ARRAY
180 OID of the `int8array` type.
181 * POINTARRAY
182 OID of the `pointarray` type.
183 * LSEGARRAY
184 OID of the `lsegarray` type.
185 * PATHARRAY
186 OID of the `patharray` type.
187 * BOXARRAY
188 OID of the `boxarray` type.
189 * FLOAT4ARRAY
190 OID of the `float4array` type.
191 * FLOAT8ARRAY
192 OID of the `float8array` type.
193 * ABSTIMEARRAY
194 OID of the `abstimearray` type.
195 * RELTIMEARRAY
196 OID of the `reltimearray` type.
197 * TINTERVALARRAY
198 OID of the `tintervalarray` type.
199 * POLYGONARRAY
200 OID of the `polygonarray` type.
201 * ACLITEM
202 OID of the `aclitem` type.
203 * ACLITEMARRAY
204 OID of the `aclitemarray` type.
205 * MACADDRARRAY
206 OID of the `macaddrarray` type.
207 * INETARRAY
208 OID of the `inetarray` type.
209 * CIDRARRAY
210 OID of the `cidrarray` type.
211 * CSTRINGARRAY
212 OID of the `cstringarray` type.
213 * BPCHAR
214 OID of the `bpchar` type.
215 * VARCHAR
216 OID of the `varchar` type.
217 * DATE
218 OID of the `date` type.
219 * TIME
220 OID of the `time` type.
221 * TIMESTAMP
222 OID of the `timestamp` type.
223 * TIMESTAMPARRAY
224 OID of the `timestamparray` type.
225 * DATEARRAY
226 OID of the `datearray` type.
227 * TIMEARRAY
228 OID of the `timearray` type.
229 * TIMESTAMPTZ
230 OID of the `timestamptz` type.
231 * TIMESTAMPTZARRAY
232 OID of the `timestamptzarray` type.
233 * INTERVAL
234 OID of the `interval` type.
235 * INTERVALARRAY
236 OID of the `intervalarray` type.
237 * NUMERICARRAY
238 OID of the `numericarray` type.
239 * TIMETZ
240 OID of the `timetz` type.
241 * TIMETZARRAY
242 OID of the `timetzarray` type.
243 * BIT
244 OID of the `bit` type.
245 * BITARRAY
246 OID of the `bitarray` type.
247 * VARBIT
248 OID of the `varbit` type.
249 * VARBITARRAY
250 OID of the `varbitarray` type.
251 * NUMERIC
252 OID of the `numeric` type.
253 * REFCURSOR
254 OID of the `refcursor` type.
255 * REFCURSORARRAY
256 OID of the `refcursorarray` type.
257 * REGPROCEDURE
258 OID of the `regprocedure` type.
259 * REGOPER
260 OID of the `regoper` type.
261 * REGOPERATOR
262 OID of the `regoperator` type.
263 * REGCLASS
264 OID of the `regclass` type.
265 * REGTYPE
266 OID of the `regtype` type.
267 * REGPROCEDUREARRAY
268 OID of the `regprocedurearray` type.
269 * REGOPERARRAY
270 OID of the `regoperarray` type.
271 * REGOPERATORARRAY
272 OID of the `regoperatorarray` type.
273 * REGCLASSARRAY
274 OID of the `regclassarray` type.
275 * REGTYPEARRAY
276 OID of the `regtypearray` type.
277 * UUID
278 OID of the `uuid` type.
279 * UUIDARRAY
280 OID of the `uuidarray` type.
281 * TSVECTOR
282 OID of the `tsvector` type.
283 * GTSVECTOR
284 OID of the `gtsvector` type.
285 * TSQUERY
286 OID of the `tsquery` type.
287 * REGCONFIG
288 OID of the `regconfig` type.
289 * REGDICTIONARY
290 OID of the `regdictionary` type.
291 * TSVECTORARRAY
292 OID of the `tsvectorarray` type.
293 * GTSVECTORARRAY
294 OID of the `gtsvectorarray` type.
295 * TSQUERYARRAY
296 OID of the `tsqueryarray` type.
297 * REGCONFIGARRAY
298 OID of the `regconfigarray` type.
299 * REGDICTIONARYARRAY
300 OID of the `regdictionaryarray` type.
301 * TXID_SNAPSHOT
302 OID of the `txid_snapshot` type.
303 * TXID_SNAPSHOTARRAY
304 OID of the `txid_snapshotarray` type.
305 * INT4RANGE
306 OID of the `int4range` type.
307 * INT4RANGEARRAY
308 OID of the `int4rangearray` type.
309 * NUMRANGE
310 OID of the `numrange` type.
311 * NUMRANGEARRAY
312 OID of the `numrangearray` type.
313 * TSRANGE
314 OID of the `tsrange` type.
315 * TSRANGEARRAY
316 OID of the `tsrangearray` type.
317 * TSTZRANGE
318 OID of the `tstzrange` type.
319 * TSTZRANGEARRAY
320 OID of the `tstzrangearray` type.
321 * DATERANGE
322 OID of the `daterange` type.
323 * DATERANGEARRAY
324 OID of the `daterangearray` type.
325 * INT8RANGE
326 OID of the `int8range` type.
327 * INT8RANGEARRAY
328 OID of the `int8rangearray` type.
329 * RECORD
330 OID of the `record` type.
331 * RECORDARRAY
332 OID of the `recordarray` type.
333 * CSTRING
334 OID of the `cstring` type.
335 * ANY
336 OID of the `any` type.
337 * ANYARRAY
338 OID of the `anyarray` type.
339 * VOID
340 OID of the `void` type.
341 * TRIGGER
342 OID of the `trigger` type.
343 * EVENT_TRIGGER
344 OID of the `event_trigger` type.
345 * LANGUAGE_HANDLER
346 OID of the `language_handler` type.
347 * INTERNAL
348 OID of the `internal` type.
349 * OPAQUE
350 OID of the `opaque` type.
351 * ANYELEMENT
352 OID of the `anyelement` type.
353 * ANYNONARRAY
354 OID of the `anynonarray` type.
355 * ANYENUM
356 OID of the `anyenum` type.
357 * FDW_HANDLER
358 OID of the `fdw_handler` type.
359 * ANYRANGE
360 OID of the `anyrange` type.
361
362 ## Properties:
363
364 * public (readonly) pq\Connection $connection
365 The connection which was used to obtain type information.