11pg_meta_data.phpt 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. --TEST--
  2. PostgreSQL pg_metadata()
  3. --EXTENSIONS--
  4. pgsql
  5. --SKIPIF--
  6. <?php include("skipif.inc"); ?>
  7. --FILE--
  8. <?php
  9. error_reporting(E_ALL);
  10. include 'config.inc';
  11. $db = pg_connect($conn_str);
  12. $meta = pg_meta_data($db, $table_name);
  13. var_dump($meta);
  14. ?>
  15. --EXPECT--
  16. array(3) {
  17. ["num"]=>
  18. array(7) {
  19. ["num"]=>
  20. int(1)
  21. ["type"]=>
  22. string(4) "int4"
  23. ["len"]=>
  24. int(4)
  25. ["not null"]=>
  26. bool(false)
  27. ["has default"]=>
  28. bool(false)
  29. ["array dims"]=>
  30. int(0)
  31. ["is enum"]=>
  32. bool(false)
  33. }
  34. ["str"]=>
  35. array(7) {
  36. ["num"]=>
  37. int(2)
  38. ["type"]=>
  39. string(4) "text"
  40. ["len"]=>
  41. int(-1)
  42. ["not null"]=>
  43. bool(false)
  44. ["has default"]=>
  45. bool(false)
  46. ["array dims"]=>
  47. int(0)
  48. ["is enum"]=>
  49. bool(false)
  50. }
  51. ["bin"]=>
  52. array(7) {
  53. ["num"]=>
  54. int(3)
  55. ["type"]=>
  56. string(5) "bytea"
  57. ["len"]=>
  58. int(-1)
  59. ["not null"]=>
  60. bool(false)
  61. ["has default"]=>
  62. bool(false)
  63. ["array dims"]=>
  64. int(0)
  65. ["is enum"]=>
  66. bool(false)
  67. }
  68. }