Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-27 Thread Lukas Fittl
On Mon, Mar 27, 2017 at 8:24 PM, Tom Lane wrote: > > Pushed with minor adjustments. > Excellent - thanks for your review and all the discussion here! > The main non-cosmetic thing I did was to replace the floor(log10()) > business with plain constant "10" as I suggested

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-27 Thread Tom Lane
Lukas Fittl writes: > On Sat, Mar 18, 2017 at 12:46 PM, Tom Lane wrote: >> So it turns out this discussion just reinvented the alternative that >> Lukas had in his 0002 proposal. Are there any remaining objections >> to proceeding with that approach? >

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-22 Thread Lukas Fittl
On Sat, Mar 18, 2017 at 12:46 PM, Tom Lane wrote: > > So it turns out this discussion just reinvented the alternative that > Lukas had in his 0002 proposal. Are there any remaining objections > to proceeding with that approach? > Thanks for reviewing - updated patch

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-18 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 13, 2017 at 6:05 PM, Tom Lane wrote: >> I wonder if it would improve matters to use $n, but starting with the >> first number after the actual external Param symbols in the query. > That sounds pretty sensible,

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-14 Thread Robert Haas
On Mon, Mar 13, 2017 at 6:05 PM, Tom Lane wrote: > Robert Haas writes: >> On Sat, Mar 4, 2017 at 1:52 PM, Peter Geoghegan wrote: >>> I'd be in favor of a change >>> that makes it easier to copy and paste a query, to run EXPLAIN and so >>>

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-13 Thread Tom Lane
Robert Haas writes: > On Sat, Mar 4, 2017 at 1:52 PM, Peter Geoghegan wrote: >> I'd be in favor of a change >> that makes it easier to copy and paste a query, to run EXPLAIN and so >> on. Lukas probably realizes that there are no guarantees that the >> query

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-09 Thread Peter Geoghegan
On Thu, Mar 9, 2017 at 8:17 PM, Bruce Momjian wrote: >> In my opinion, we expose query id (and dbid, and userid) as the >> canonical identifier for each pg_stat_statements entry, and have done >> so for some time. That's the stable API -- not query text. I'm aware >> of cases

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-09 Thread Bruce Momjian
On Sat, Mar 4, 2017 at 10:52:44AM -0800, Peter Geoghegan wrote: > On Sat, Mar 4, 2017 at 8:02 AM, Tom Lane wrote: > > Meh ... we've generally regretted it when we "solved" a backwards > > compatibility problem by introducing a GUC that changes query semantics. > > I'm

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-06 Thread Lukas Fittl
On Mon, Mar 6, 2017 at 9:36 AM, Robert Haas wrote: > On Sat, Mar 4, 2017 at 1:52 PM, Peter Geoghegan wrote: > > In my opinion, we expose query id (and dbid, and userid) as the > > canonical identifier for each pg_stat_statements entry, and have done > > so

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-06 Thread Robert Haas
On Sat, Mar 4, 2017 at 1:52 PM, Peter Geoghegan wrote: > On Sat, Mar 4, 2017 at 8:02 AM, Tom Lane wrote: >>> Perhaps there could be a choice of behaviors. Even if we all agreed >>> that parameter notation was better in theory, there's something to be >>> said

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-04 Thread Andres Freund
Hi, On 2017-03-04 11:02:14 -0500, Tom Lane wrote: > But speaking of ambiguity: isn't it possible for $n symbols to appear in > pg_stat_statements already? Indeed. > I think it is, both from extended-protocol > client queries and from SPI commands, which would mean that the proposal > as it

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-04 Thread Peter Geoghegan
On Sat, Mar 4, 2017 at 8:02 AM, Tom Lane wrote: >> Perhaps there could be a choice of behaviors. Even if we all agreed >> that parameter notation was better in theory, there's something to be >> said for maintaining backward compatibility, or having an option to do >> so. > >

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-04 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 1, 2017 at 8:21 PM, Peter Eisentraut > wrote: >> On 2/28/17 20:01, Lukas Fittl wrote: >>> I'd like to propose changing the replacement character from ? to instead >>> be a parameter (like $1). >> Hmm, I

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-03 Thread Robert Haas
On Wed, Mar 1, 2017 at 8:21 PM, Peter Eisentraut wrote: > On 2/28/17 20:01, Lukas Fittl wrote: >> Currently pg_stat_statements replaces constant values with ? characters. >> I've seen this be a problem on multiple occasions, in particular since >> it conflicts

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-01 Thread Lukas Fittl
On Wed, Mar 1, 2017 at 6:51 AM, Peter Eisentraut < peter.eisentr...@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

Re: [HACKERS] [PATCH] Use $ parameters as replacement characters for pg_stat_statements

2017-03-01 Thread Peter Eisentraut
On 2/28/17 20:01, Lukas Fittl wrote: > Currently pg_stat_statements replaces constant values with ? characters. > I've seen this be a problem on multiple occasions, in particular since > it conflicts with the use of ? as an operator. > > I'd like to propose changing the replacement character from