pg_meta_data pg_meta_data (PHP 4 >= 4_3_0)
pg_meta_data __
Get meta data for table_
Description array
pg_meta_data ( resource connection, string table_name)
pg_meta_data() returns table definition for
table_name as an array_ If there is error, it
returns FALSE
Ejemplo 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 would produce the following 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)
}
}
Aviso Esta función
es EXPERIMENTAL _ Esto significa que el
comportamiento de esta función, el nombre de esta
función y en definitiva TODO lo documentado sobre esta
función, puede cambiar en una futura version de PHP SIN
AVISO_ La advertencia queda hecha, y utilizar esta extensión
queda bajo su propia responsabiliad_
See also pg_convert() _