diff options
Diffstat (limited to 'it_dbi_postgres.class')
-rw-r--r-- | it_dbi_postgres.class | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/it_dbi_postgres.class b/it_dbi_postgres.class index 1161632..bce0fd9 100644 --- a/it_dbi_postgres.class +++ b/it_dbi_postgres.class @@ -110,11 +110,10 @@ function _query($query, $p) if (!($result = pg_query($this->_link, $query)) && $p['safety']) { - /* TODO - $errno = mysqli_errno($this->_link); - if (($p['safety'] < 2) && ($errno == 1062)) # Duplicate entry - return false; + if (($p['safety'] < 2) && it::match('duplicate key value', pg_last_error($this->_link))) # Duplicate entry + return null; + /* TODO if ($errno == 2006) # mysql server has gone away: retry { it::log('sqllog', "it_dbi(): reconnecting mysqli_connect {$p['server']}, {$p['db']}"); |