Re: BUG #4843: non standard use string literal warning in RAISE WARNING

Lists: pgsql-bugs
From: "Regina" <lr(at)pcorp(dot)us>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4843: non standard use string literal warning in RAISE WARNING
Date: 2009-06-08 04:48:58
Message-ID: 200906080448.n584mwTk023104@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4843
Logged by: Regina
Email address: lr(at)pcorp(dot)us
PostgreSQL version: 8.4beta2
Operating system: Windows
Description: non standard use string literal warning in RAISE WARNING
Details:

I'm not sure if this is a bug or expected behavior. But in a new PostGIS
function we are writing, we are getting a

WARNING: nonstandard use of \' in a string literal HINT: Use to write
quotes in strings, or use the escape string syntax (E'...').

With sections of the code that look like
RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could
not determine ndims', quote_ident(gcs.attname), quote_ident(gcs.nspname),
quote_ident(gcs.relname);

The same function on 8.3.7 does not do this. I verified I have the
escape_string_warning switch enabled on both installs.

Details of the issue can be found here

http://trac.osgeo.org/postgis/ticket/190#comment:4


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Regina" <lr(at)pcorp(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4843: non standard use string literal warning in RAISE WARNING
Date: 2009-06-08 13:57:35
Message-ID: 12158.1244469455@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Regina" <lr(at)pcorp(dot)us> writes:
> I'm not sure if this is a bug or expected behavior. But in a new PostGIS
> function we are writing, we are getting a

> WARNING: nonstandard use of \' in a string literal HINT: Use to write
> quotes in strings, or use the escape string syntax (E'...').

> With sections of the code that look like
> RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could
> not determine ndims', quote_ident(gcs.attname), quote_ident(gcs.nspname),
> quote_ident(gcs.relname);

> The same function on 8.3.7 does not do this.

This is an intended change: RAISE format strings are now processed the
same as any other string literal. Personally I'd suggest using '' here
rather than \' --- more standard, more future-proof, etc.

(Hmm, there seems to be nothing about it in the release notes ... not
sure how we overlooked that.)

regards, tom lane