note 111540 added to function.pg-field-type
| From: | JoshuaBurns | Date: | Fri, 01 Mar 2013 22:29:25 +0000 |
| Subject: | note 111540 added to function.pg-field-type | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-193771@lists.php.net to get a copy of this message | ||
Here is an updated list of nearly every PostgreSQL data type, and PHP's internal C-type
equivalent, updated for PostgreSQL 9.2. The first array maps PHP's internal data type to
PostgreSQL's equivalents. The second maps PostgreSQL's data-types to PHP's
equivalents.
<?php
$php_to_pg = array(
'bit' => array('bit'),
'bool' => array('boolean'),
'box' => array('box'),
'bpchar' => array('character','char'),
'bytea' => array('bytea'),
'cidr' => array('cidr'),
'circle' => array('circle'),
'date' => array('date'),
'daterange' => array('daterange'),
'float4' => array('real'),
'float8' => array('double precision'),
'inet' => array('inet'),
'int2' => array('smallint', 'smallserial'),
'int4' => array('integer', 'serial'),
'int4range' => array('int4range'),
'int8' => array('bigint', 'bigserial'),
'int8range' => array('int8range'),
'interval' => array('interval'),
'json' => array('json'),
'lseg' => array('lseg'),
'macaddr' => array('macaddr'),
'money' => array('money'),
'numeric' => array('decimal', 'numeric'),
'numrange' => array('numrange'),
'path' => array('path'),
'point' => array('point'),
'polygon' => array('polygon'),
'text' => array('text'),
'time' => array('time', 'time without time zone'),
'timestamp' => array('timestamp', 'timestamp without time zone'),
'timestamptz' => array('timestamp with time zone'),
'timetz' => array('time with time zone'),
'tsquery' => array('tsquery'),
'tsrange' => array('tsrange'),
'tsvector' => array('tsvector'),
'uuid' => array('uuid'),
'varbit' => array('bit varying'),
'varchar' => array('character varying', 'varchar'),
'xml' => array('xml'),
);
$pg_to_php = array(
'bit' => 'bit',
'boolean' => 'bool',
'box' => 'box',
'character' => 'bpchar',
'char' => 'bpchar',
'bytea' => 'bytea',
'cidr' => 'cidr',
'circle' => 'circle',
'date' => 'date',
'daterange' => 'daterange',
'real' => 'float4',
'double precision' => 'float8',
'inet' => 'inet',
'smallint' => 'int2',
'smallserial' => 'int2',
'integer' => 'int4',
'serial' => 'int4',
'int4range' => 'int4range',
'bigint' => 'int8',
'bigserial' => 'int8',
'int8range' => 'int8range',
'interval' => 'interval',
'json' => 'json',
'lseg' => 'lseg',
'macaddr' => 'macaddr',
'money' => 'money',
'decimal' => 'numeric',
'numeric' => 'numeric',
'numrange' => 'numrange',
'path' => 'path',
'point' => 'point',
'polygon' => 'polygon',
'text' => 'text',
'time' => 'time',
'time without time zone' => 'time',
'timestamp' => 'timestamp',
'timestamp without time zone' => 'timestamp',
'timestamp with time zone' => 'timestamptz',
'time with time zone' => 'timetz',
'tsquery' => 'tsquery',
'tsrange' => 'tsrange',
'tstzrange' => 'tstzrange',
'tsvector' => 'tsvector',
'uuid' => 'uuid',
'bit varying' => 'varbit',
'character varying' => 'varchar',
'varchar' => 'varchar',
'xml' => 'xml'
);
?>
----
Server IP: 69.147.83.199
Probable Submitter: 68.40.7.150
----
Manual Page -- http://php.net/manual/en/function.pg-field-type.php
Edit -- https://master.php.net/note/edit/111540
Del: integrated -- https://master.php.net/note/delete/111540/integrated
Del: useless -- https://master.php.net/note/delete/111540/useless
Del: bad code -- https://master.php.net/note/delete/111540/bad+code
Del: spam -- https://master.php.net/note/delete/111540/spam
Del: non-english -- https://master.php.net/note/delete/111540/non-english
Del: in docs -- https://master.php.net/note/delete/111540/in+docs
Del: other reasons-- https://master.php.net/note/delete/111540
Reject -- https://master.php.net/note/reject/111540
Search -- https://master.php.net/manage/user-notes.php