Re: scan.l: check_escape_warning()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: scan.l: check_escape_warning()
Date: 2008-01-11 15:41:17
Message-ID: 13483.1200066077@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Meskes <meskes(at)postgresql(dot)org> writes:
> could anyone please enlighten me whether this function is still needed?
> AFAICT check_escape_warning() only has significant action if
> warn_on_first_escape is true. This variable is set to true only on label
> xqstart, but to false on xestart. However, check_escape_warning() and
> check_string_escape_warning() btw. are only called in mode xe. Seems to
> me that both are never called, or what am I missing?

Huh?

regression=# \set VERBOSITY verbose
regression=# select '\002'::text;
WARNING: 22P06: nonstandard use of escape in a string literal
LINE 1: select '\002'::text;
^
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
LOCATION: check_escape_warning, scan.l:967
text
------
\x02
(1 row)

regression=# select '\\'::text;
WARNING: 22P06: nonstandard use of \\ in a string literal
LINE 1: select '\\'::text;
^
HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
LOCATION: check_string_escape_warning, scan.l:952
text
------
\
(1 row)

Perhaps there's some discrepancy between the ecpg and backend lexers
as to where these are called?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-01-11 16:15:06 Transaction Snapshot Cloning
Previous Message Roberts, Jon 2008-01-11 15:32:05 could not open relation: Invalid argument