Re: let's make the list of reportable GUCs configurable (was Re: Add %r substitution for psql prompts to show recovery status)

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Dave Cramer <pg(at)fastcrypt(dot)com>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: let's make the list of reportable GUCs configurable (was Re: Add %r substitution for psql prompts to show recovery status)
Date: 2019-10-11 05:13:33
Message-ID: CAMsr+YF6gWwrewm5m1d_D3KFZ-jD76hyZBAD6LCER7k9p2V5Pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 10 Oct 2019 at 23:45, Andres Freund <andres(at)anarazel(dot)de> wrote:

>
> Unless schema qualified you can't rely on that even without search_path
> changing. Consider an object in schema b existing, with a search_path of
> a,b. Even without the search path changing, somebody could create a type
> in a, "masking" the one in b.

True. I remember dealing with (or trying to deal with) that mess in BDR's
DDL replication.

I guess the question becomes "what is required to to permit apps, clients
or drivers to safely and efficiently cache mappings of object names to
server side metadata".

E.g. if I have a non-schema-qualified relation name what server side help
is needed to make it possible to safely cache its column names, column
order, and column types? Or for a given function name, cache whether it's a
function or procedure, its IN, INOUT and OUT parameter names, positions and
types, etc?

You sensibly point out that being notified of search_path changes is not
sufficient. It might still be useful.

We have comprehensive server-side cache invalidation support. I wonder if
it's reasonable to harness that. Let clients request that we accumulate
invalidations and deliver them on the wire to the client at the end of each
statement, before ReadyForQuery, along with a backend-local invalidation
epoch that increments each time we send invalidations to the client.

The problem is that the client would have to send the invalidation epoch
along with each query so the server could tell it to flush its cache and
retry if there were invalidations since the end of the last query.

None of that is likely to be pretty given that we've been unable to agree
on any way to extend the protocol at client request.

Anyone have any ideas for "near enough is good enough" approaches or
methods that'd work with some client assistance / extension support / etc?

--
Craig Ringer http://www.2ndQuadrant.com/
2ndQuadrant - PostgreSQL Solutions for the Enterprise

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2019-10-11 06:05:54 Re: adding partitioned tables to publications
Previous Message Michael Lewis 2019-10-11 04:48:08 Re: BRIN index which is much faster never chosen by planner