Re: Storing pg_stat_statements query texts externally, pg_stat_statements in core

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Storing pg_stat_statements query texts externally, pg_stat_statements in core
Date: 2014-01-25 21:13:15
Message-ID: CAM3SWZQLR0zqq6P0WmCL7nR4-9TZ3gHez+5u28i5BX7EpNSHdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 25, 2014 at 11:04 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-01-25 21:21:20 Re: GIN improvements part2: fast scan
Previous Message Tom Lane 2014-01-25 21:11:26 Re: Storing pg_stat_statements query texts externally, pg_stat_statements in core