Re: pg_stat_statements and non default search_path

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_statements and non default search_path
Date: 2016-10-10 03:00:34
Message-ID: 379b1b93-e23e-be7a-e77d-b4db00fe932b@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/7/16 4:39 AM, Julien Rouhaud wrote:
> I see two ways of fixing this. First one would be to store normalized
> queries while fully qualifiying the relation's names. After a quick look
> this can't be done without storing at least a token location in
> RangeTblEntry nodes, which sounds like a bad idea.
>
> The other way would be to store the value of search_path with each pgss
> entry (either in shared_memory or in the external file).
>
> Is it something that we should fix, and if yes is any of this
> acceptable, or does someone see another way to solve this problem?

Would another option be to temporarily set search_path to '' when
getting the query text? ISTM that would be the best option.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532) mobile: 512-569-9461

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-10-10 03:24:27 Re: Fast AT ADD COLUMN with DEFAULTs
Previous Message Bruce Momjian 2016-10-10 02:54:02 Re: proposal: psql \setfileref