Re: Differences in Escaped bytea's when creating a plain pg_dump

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "WR" <wolle321(at)freenet(dot)de>
Cc: "pgsql-general" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Differences in Escaped bytea's when creating a plain pg_dump
Date: 2022-06-27 10:12:53
Message-ID: f15fa1a1-7a06-4124-aa23-5ec5731542a7@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

WR wrote:

> First run worked.
> Second run worked.
> Then I changed to SET standard_conforming_strings = off;
> Third run worked.
> Fourth run throw the error
> Then I changed back to SET standard_conforming_strings = on;
> Fifth run throw the error too.
> And only adding E and second backslash helped.

This kind of unstable behavior can be seen if the SET may not be
executed by the same session (same connection to the server) as the
subsequent queries.
SET affects only the session it's being run in.

For instance a connection pooler configured in statement mode may
produce that behavior. The solution in the case of a connection pooler
is to group related statements into a transaction.

Maybe pgAdmin has a pooler like that, but if you're issuing the statements
in the same SQL window, I would find it quite surprising that it doesn't
run them by the same session.
Or maybe you're mixing queries from different SQL windows that each
have their own connection, and in some cases you do the SET
in a window and the INSERT in another window.
Or maybe it's a pgAdmin bug.

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2022-06-27 10:28:18 Re: help for pg_wal issue
Previous Message Laurenz Albe 2022-06-27 10:01:41 Re: Table space not returned to the OS ?