php man page for pg_meta_data

Query: pg_meta_data

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

PG_META_DATA(3) 														   PG_META_DATA(3)

pg_meta_data - Get meta data for table

SYNOPSIS
array pg_meta_data (resource $connection, string $table_name, [bool $extended])
DESCRIPTION
pg_meta_data(3) returns table definition for table_name as an array.
PARAMETERS
o $connection - PostgreSQL database connection resource. o $table_name - The name of the table. o $extended - Flag for returning extended meta data. Default to FALSE.
RETURN VALUES
An array of the table definition, or FALSE on error.
EXAMPLES
Example #1 Getting table metadata <?php $dbconn = pg_connect("dbname=publisher") or die("Could not connect"); $meta = pg_meta_data($dbconn, 'authors'); if (is_array($meta)) { echo '<pre>'; var_dump($meta); echo '</pre>'; } ?> The above example will output: array(3) { ["author"]=> array(5) { ["num"]=> int(1) ["type"]=> string(7) "varchar" ["len"]=> int(-1) ["not null"]=> bool(false) ["has default"]=> bool(false) } ["year"]=> array(5) { ["num"]=> int(2) ["type"]=> string(4) "int2" ["len"]=> int(2) ["not null"]=> bool(false) ["has default"]=> bool(false) } ["title"]=> array(5) { ["num"]=> int(3) ["type"]=> string(7) "varchar" ["len"]=> int(-1) ["not null"]=> bool(false) ["has default"]=> bool(false) } }
CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.6.0 | | | | | | | No longer experimental. Added "is enum" as | | | default attribute. $extended flag is added. | | | | +--------+---------------------------------------------------+
SEE ALSO
pg_convert(3). PHP Documentation Group PG_META_DATA(3)
Related Man Pages
pg_send_execute(3) - php
parsekit_compile_string(3) - php
parsekit_func_arginfo(3) - php
pg_delete(3) - php
pg_meta_data(3) - php
Similar Topics in the Unix Linux Community
unary operator expected error
grep across multiple lines
Extract Parts of File