Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pg_meta_data(3) [php man page]

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)

Check Out this Related Man Page

MYSQLND_MS_MATCH_WILD(3)						 1						  MYSQLND_MS_MATCH_WILD(3)

mysqlnd_ms_match_wild - Finds whether a table name matches a wildcard pattern or not

SYNOPSIS
bool mysqlnd_ms_match_wild (string $table_name, string $wildcard) DESCRIPTION
Finds whether a table name matches a wildcard pattern or not. This function is not of much practical relevance with PECL mysqlnd_ms 1.1.0 because the plugin does not support MySQL replication table filtering yet. PARAMETERS
o $table_name - The table name to check if it is matched by the wildcard. o $wildcard - The wildcard pattern to check against the table name. The wildcard pattern supports the same placeholders as MySQL replication filters do. MySQL replication filters can be configured by using the MySQL Server configuration options --replicate-wild-do-table and --replicate-wild-do-db. Please, consult the MySQL Reference Manual to learn more about this MySQL Server feature. The sup- ported placeholders are: o % - zero or more literals o _ - one literal Placeholders can be escaped using . RETURN VALUES
Returns TRUE table_name is matched by wildcard. Otherwise, returns FALSE EXAMPLES
Example #1 mysqlnd_ms_match_wild(3) example <?php var_dump(mysqlnd_ms_match_wild("schema_name.table_name", "schema%")); var_dump(mysqlnd_ms_match_wild("abc", "_")); var_dump(mysqlnd_ms_match_wild("table1", "table_")); var_dump(mysqlnd_ms_match_wild("asia_customers", "%customers")); var_dump(mysqlnd_ms_match_wild("funny%table","funny\%table")); var_dump(mysqlnd_ms_match_wild("funnytable", "funny%table")); ?> The above example will output: bool(true) bool(false) bool(true) bool(true) bool(true) bool(true) PHP Documentation Group MYSQLND_MS_MATCH_WILD(3)
Man Page