Re: PgAdmin 4.2 unable to connect to AWS Postgres read-replica instances

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: "Bawol, Brian" <brian(dot)bawol(at)freightverify(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org, pgadmin-support(at)lists(dot)postgresql(dot)org
Subject: Re: PgAdmin 4.2 unable to connect to AWS Postgres read-replica instances
Date: 2019-02-07 20:23:21
Message-ID: 25216.1549571001@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-admin

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> On 2019-Feb-07, Bawol, Brian wrote:
>> It looks like this is the query that occurs at the same time:
>> STATEMENT: SET DateStyle=ISO; SET client_min_messages=notice;UPDATE
>> pg_settings SET setting = 'escape' WHERE name = 'bytea_output';SET
>> client_encoding='UNICODE';

> Ah, so pgadmin 4.2 is trying to set bytea_output, which is disallowed;
> the reason it says "cannot execute SELECT" is that the UPDATE for the
> view is turned into a "SELECT set_config()" by a view rule.

Right, and the transformed query still specifies that pg_settings
should be checked for UPDATE privilege, which is what is making
ExecCheckXactReadOnly spit up on it.

In principle you could argue that ExecCheckXactReadOnly could be smarter
about this type of situation. A probably more significant issue is that a
permissions check is a really strange, and not at all bulletproof-seeming,
way of deciding whether a query is read-only. But I don't have any
burning desire to redesign that right now.

> This looks like a pgadmin bug ...

Looking at it, I'm betting somebody thought this was a cute way to
set bytea_output if it exists, without getting a failure on servers
too old to have it. We added that in 9.0, so maybe it's not quite
old enough to make it a moot point; but failing on RO servers is
not nice either. Anyway, yeah, it's pgadmin's problem to fix.

regards, tom lane

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Tom Lane 2019-02-07 20:28:38 Re: PgAdmin 4.2 unable to connect to AWS Postgres read-replica instances
Previous Message Alvaro Herrera 2019-02-07 19:56:05 Re: PgAdmin 4.2 unable to connect to AWS Postgres read-replica instances

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2019-02-07 20:28:38 Re: PgAdmin 4.2 unable to connect to AWS Postgres read-replica instances
Previous Message Alvaro Herrera 2019-02-07 19:56:05 Re: PgAdmin 4.2 unable to connect to AWS Postgres read-replica instances