pg_meta_data 获得表的元数据 &reftitle.description; arrayfalsepg_meta_data PgSql\Connectionconnection stringtable_name boolextended&false; pg_metadata 以数组形式返回 table_name 的表定义。 &reftitle.parameters; connection &pgsql.parameter.connection; table_name 表名。 extended 用于返回扩展元数据的 flag。默认为 &false;。 &reftitle.returnvalues; array 形式返回表定义,&return.falseforfailure;。 &reftitle.changelog; &Version; &Description; &pgsql.changelog.connection-object; &reftitle.examples; 取得表的元数据 '; var_dump($meta); echo ''; } ?> ]]> &example.outputs; 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) } } ]]> &reftitle.seealso; pg_convert