summaryrefslogtreecommitdiff
path: root/drivers/adodb-postgres64.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/adodb-postgres64.inc.php')
-rw-r--r--drivers/adodb-postgres64.inc.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php
index b1d161d7..5cbe77ed 100644
--- a/drivers/adodb-postgres64.inc.php
+++ b/drivers/adodb-postgres64.inc.php
@@ -138,7 +138,8 @@ class ADODB_postgres64 extends ADOConnection{
// get the last id - never tested
function pg_insert_id($tablename,$fieldname)
{
- $result=pg_query($this->_connectionID, 'SELECT last_value FROM '. $tablename .'_'. $fieldname .'_seq');
+ $sequence = pg_escape_identifier($this->_connectionID, $tablename .'_'. $fieldname .'_seq');
+ $result = pg_query($this->_connectionID, 'SELECT last_value FROM '. $sequence);
if ($result) {
$arr = @pg_fetch_row($result,0);
pg_free_result($result);