1--TEST--
2PostgreSQL pg_meta_data() - basic test using schema
3--SKIPIF--
4<?php include("skipif.inc"); ?>
5--FILE--
6<?php
7
8include('config.inc');
9
10$conn = pg_connect($conn_str);
11
12pg_query('CREATE SCHEMA phptests');
13
14pg_query('CREATE TABLE phptests.foo (id INT, id2 INT)');
15
16pg_query('CREATE TABLE foo (id INT, id3 INT)');
17
18
19var_dump(pg_meta_data($conn, 'foo'));
20var_dump(pg_meta_data($conn, 'phptests.foo'));
21
22
23pg_query('DROP TABLE foo');
24pg_query('DROP TABLE phptests.foo');
25pg_query('DROP SCHEMA phptests');
26
27?>
28--EXPECT--
29array(2) {
30  ["id"]=>
31  array(6) {
32    ["num"]=>
33    int(1)
34    ["type"]=>
35    string(4) "int4"
36    ["len"]=>
37    int(4)
38    ["not null"]=>
39    bool(false)
40    ["has default"]=>
41    bool(false)
42    ["array dims"]=>
43    int(0)
44  }
45  ["id3"]=>
46  array(6) {
47    ["num"]=>
48    int(2)
49    ["type"]=>
50    string(4) "int4"
51    ["len"]=>
52    int(4)
53    ["not null"]=>
54    bool(false)
55    ["has default"]=>
56    bool(false)
57    ["array dims"]=>
58    int(0)
59  }
60}
61array(2) {
62  ["id"]=>
63  array(6) {
64    ["num"]=>
65    int(1)
66    ["type"]=>
67    string(4) "int4"
68    ["len"]=>
69    int(4)
70    ["not null"]=>
71    bool(false)
72    ["has default"]=>
73    bool(false)
74    ["array dims"]=>
75    int(0)
76  }
77  ["id2"]=>
78  array(6) {
79    ["num"]=>
80    int(2)
81    ["type"]=>
82    string(4) "int4"
83    ["len"]=>
84    int(4)
85    ["not null"]=>
86    bool(false)
87    ["has default"]=>
88    bool(false)
89    ["array dims"]=>
90    int(0)
91  }
92}
93