Re: nonstandard use of

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Peckham, Martin *EXTERN*" <martin(dot)peckham(at)guidancesoftware(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: nonstandard use of
Date: 2007-10-30 07:10:09
Message-ID: D960CB61B694CF459DCFB4B0128514C26ABA9A@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martin Peckham wrote:
> I recently installed the latest non-beta version 8.2 of postgresql.
>
> I get the following warning and hint in the server status GUI:
>
> WARNING: nonstandard use of \\ in a string literal at characters 64
> HINT: Use the excape string syntax for backslashes, e.g, E'\\'.
>
> The "raw" string I want to write is:
>
> [\x09-\x0A\x0D\x20-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E]MI[\x09-\x0
> A\x0D\x20-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E]
>
> After escaping, I write:
>
> [\\x09-\\x0A\\x0D\\x20-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E]
> MI[\\x09-\\x0A\\x0D\\x20-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E]
>
> Assuming the count starts at 0, the character at position 64
> is the [ character.
>
> I've read an earlier post that tells of how to SUPRESS the
> warning. I want to eliminate the warning.

I reckon that "64" refers to the position of the string in the
SQL statement, i.e. the string starts at that position in the statement.
Is that possible?

To get rid of the warning, you can either:

- *not* double the backslashes and set standard_conforming_strings
to "on".
- prepend each string literal with an E as the warning suggests.
- set escape_string_warning to "off".

The first solution is the best, the last the worst.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2007-10-30 07:13:43 Re: postgres bash prompt error while user creation
Previous Message Troy Rasiah 2007-10-30 05:36:20 Re: how to unsubscribe from this group?