Re: Error while updating a table - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: Error while updating a table
Date
Msg-id 20250419194203.i6iksccdvqgck4cy@hjp.at
Whole thread Raw
In response to Re: Error while updating a table  ("sivapostgres@yahoo.com" <sivapostgres@yahoo.com>)
List pgsql-general
On 2025-04-19 13:06:27 +0000, sivapostgres@yahoo.com wrote:
> Thanks Laurenz,
> > it is 100% clear that an earlier statement in the same transaction must
> > have got an error.  Write your application so that it logs *every* error
> > that comes from the database, then you are sure to catch that error.
>
> There is an option to log every sql statement that's executed from the
> application.  Unfortunately, that option was not set at that time.

You don't have to log every sql statement. Just the ones which cause
errors. As Laurenz mentioned, that happens automatically with the
default settings.

> Even I enable it now, I can't figure out that error.

Just search the logs for the string "ERROR".

> By any chance, if I get that statement, what should I do?

1) Read the error message.
2) Figure out what caused the error
3) Fix the problem

        hjp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment

pgsql-general by date:

Previous
From: Vijaykumar Jain
Date:
Subject: Re: verify checksums online
Next
From: Igor Korot
Date:
Subject: Re: Clarification on the docs