Thread: PostgreSQL nonstandard use of escape in a string literal

PostgreSQL nonstandard use of escape in a string literal

From
"Johnson, Trevor"
Date:

Using Moodle with PostgreSQL 8.4 and we get warning messages...

2009-09-18 13:48:11 ESTWARNING:  nonstandard use of escape in a string literal at character 209

2009-09-18 13:48:11 ESTHINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.

 

“standard_conforming_strings” is set to off, if we turn it on it breaks Moodle.

 

Are these just warnings or is there something we need to fix?

If so is it okay to turn the warnings with escape_string_warning = off ?

 

 

Regards

 

Trevor

Trevor Johnson
Applications and Database Administrator | Information Management Services Division | TAFE NSW Riverina Institute
Ph 02 69381351 | Fax 02 69381432 | Mob 0418 600606 | email: trevor.johnson@det.nsw.edu.au  

 


**********************************************************************
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**********************************************************************

Re: PostgreSQL nonstandard use of escape in a string literal

From
Jeff Davis
Date:
On Fri, 2009-09-18 at 14:05 +1000, Johnson, Trevor wrote:
> Are these just warnings or is there something we need to fix?

They are just warnings. The application is apparently written assuming
the non-standard quoting for string literals.

> If so is it okay to turn the warnings with escape_string_warning =
> off ?

I recommend you inform the authors of the application that they should
update it to use standard-conforming string literals. Then, you can turn
"escape_string_warning = off" to suppress the warnings while you are
waiting for them to fix it.

Regards,
    Jeff Davis



Re: PostgreSQL nonstandard use of escape in a string literal

From
Peter Eisentraut
Date:
On fre, 2009-09-18 at 14:05 +1000, Johnson, Trevor wrote:
> Using Moodle with PostgreSQL 8.4 and we get warning messages...
>
> 2009-09-18 13:48:11 ESTWARNING:  nonstandard use of escape in a string
> literal at character 209
>
> 2009-09-18 13:48:11 ESTHINT:  Use the escape string syntax for
> escapes, e.g., E'\r\n'.

> “standard_conforming_strings” is set to off, if we turn it on it
> breaks Moodle.

> Are these just warnings or is there something we need to fix?

Well, in your case they are apparently "estwarnings" because you didn't
put a space at the end of log_line_prefix ;-), but really they are just
warnings.  In the long run, you will want to switch to doing what the
hint, er, esthint says, after which setting standard_conforming_strings
to on becomes OK.  Moodle will need to do the same first as well.