adodb-postgres8.inc.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /*
  3. @version v5.20.3 01-Jan-2016
  4. @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
  5. @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
  6. Released under both BSD license and Lesser GPL library license.
  7. Whenever there is any discrepancy between the two licenses,
  8. the BSD license will take precedence.
  9. Set tabs to 4.
  10. Postgres8 support.
  11. */
  12. // security - hide paths
  13. if (!defined('ADODB_DIR')) die();
  14. include_once(ADODB_DIR."/drivers/adodb-postgres7.inc.php");
  15. class ADODB_postgres8 extends ADODB_postgres7
  16. {
  17. var $databaseType = 'postgres8';
  18. /**
  19. * Retrieve last inserted ID
  20. * Don't use OIDs, since as per {@link http://php.net/function.pg-last-oid php manual }
  21. * they won't be there in Postgres 8.1
  22. * (and they're not what the application wants back, anyway).
  23. * @param string $table
  24. * @param string $column
  25. * @return int last inserted ID for given table/column, or the most recently
  26. * returned one if $table or $column are empty
  27. */
  28. function _insertid($table, $column)
  29. {
  30. return empty($table) || empty($column)
  31. ? $this->GetOne("SELECT lastval()")
  32. : $this->GetOne("SELECT currval(pg_get_serial_sequence('$table', '$column'))");
  33. }
  34. }
  35. class ADORecordSet_postgres8 extends ADORecordSet_postgres7
  36. {
  37. var $databaseType = "postgres8";
  38. }
  39. class ADORecordSet_assoc_postgres8 extends ADORecordSet_assoc_postgres7
  40. {
  41. var $databaseType = "postgres8";
  42. }