11pg_meta_data.phpt 1020 B

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