Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements - Mailing list pgsql-hackers

From Lukas Fittl
Subject Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements
Date
Msg-id CAP53Pkxbatdf06MfGzkTK-RnzSUga9pxaMVaV9tGBMjBoAgM6Q@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Use $ parameters as replacement characters forpg_stat_statements  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On Wed, Mar 1, 2017 at 6:51 AM, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
Hmm, I think this could confuse people into thinking that the queries
displayed were in fact prepared queries.

Maybe we could gather some more ideas.

I think thats a reasonable concern - the main benefit of $1 is that its already designated as something that can replace a constant, and still be read by the Postgres parser.

Is there any other character that has the same properties?

I'll also note that Greg Stark mentioned in [0] that "There's another feature pg_stat_statements *really* needs. A way to convert a jumbled statement into one that can be prepared easily. The use of ? instead of :1 :2 etc makes this a mechanical but annoying process."

Using $1, $2, etc. for jumbling statements would give us that for free, no additional effort needed.


Best,
Lukas

--
Lukas Fittl

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] patch: function xmltable
Next
From: Kouhei Kaigai
Date:
Subject: Re: [HACKERS] PassDownLimitBound for ForeignScan/CustomScan [take-2]