Re: Storing pg_stat_statements query texts externally, pg_stat_statements in core - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Storing pg_stat_statements query texts externally, pg_stat_statements in core
Date
Msg-id CAM3SWZQLR0zqq6P0WmCL7nR4-9TZ3gHez+5u28i5BX7EpNSHdQ@mail.gmail.com
Whole thread Raw
In response to Re: Storing pg_stat_statements query texts externally, pg_stat_statements in core  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, Jan 25, 2014 at 11:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Do the regression tests fail for you when doing this?
>
> What I see is a duplicate occurrence of an escape_string_warning bleat:
>
> *** /home/postgres/pgsql/src/test/regress/expected/plpgsql.out  Fri Jan  3 17:07
> :46 2014
> --- /home/postgres/pgsql/src/test/regress/results/plpgsql.out   Sat Jan 25 13:37
> :20 2014
> ***************
> *** 4568,4573 ****
> --- 4568,4579 ----
>   HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
>   QUERY:  SELECT 'foo\\bar\041baz'
>   CONTEXT:  PL/pgSQL function strtest() line 4 at RETURN
> + WARNING:  nonstandard use of \\ in a string literal
> + LINE 1: SELECT 'foo\\bar\041baz'
> +                ^
> + HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
> + QUERY:  SELECT 'foo\\bar\041baz'
> + CONTEXT:  PL/pgSQL function strtest() line 4 at RETURN
>      strtest
>   -------------
>    foo\bar!baz
>
> ======================================================================
>
> which seems to happen because generate_normalized_query() reruns the
> core lexer on the given statement, and if you got a warning the first
> time, you'll get another one.

Oh, yes, I noticed that and reached the same conclusion. Sorry, I
probably should have mentioned this pro-actively.


-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Storing pg_stat_statements query texts externally, pg_stat_statements in core
Next
From: Heikki Linnakangas
Date:
Subject: Re: GIN improvements part2: fast scan