diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index e0e3716473a..e340af866cc 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -556,9 +556,12 @@ class DoliDBPgsql
{
if (! $ret)
{
- $this->lastqueryerror = $query;
- $this->lasterror = $this->error();
- $this->lasterrno = $this->errno();
+ if ($this->errno() != 'DB_ERROR_25P02')
+ {
+ $this->lastqueryerror = $query;
+ $this->lasterror = $this->error();
+ $this->lasterrno = $this->errno();
+ }
dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING);
//print "\n>> ".$query."
\n";
//print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."
\n";