Re: Documentation on standard conforming strings? - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Documentation on standard conforming strings?
Date
Msg-id D960CB61B694CF459DCFB4B0128514C203A89824@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Documentation on standard conforming strings?  (Preston de Guise <preston@anywebdb.com>)
List pgsql-general
Preston de Guise wrote:
> I don't yet properly understand the conforming strings implementation
> that came in 8.3 The manual (to me at least) has been a little
> imprecise in describing the implications for correctly inserting data
> with this enabled without getting back a plethora of warnings, or
> having the inserts fail completely.
>
> Is anyone aware of a good "how to" document on conforming strings
> covering such topics as:
>
> - Valid quoting methods and when the various ones should be used
> - Criteria for warnings (in some instances it seems you can get
> warnings about them no matter how 'safely' you insert? I.e., I know
> I'm likely to still be doing things wrong...)
> (- Any coverage of DBD::Pg's capabilities would be a great bonus)

I'll try to describe it in a few simple lines:

- with standard_conforming_strings=off, backslashes in string constants
  are always interpreted as escape characters.
- with standard_conforming_strings=on, backslashes in string constants
  are interpreted as escape characters *only* if the string constant is
  preceeded by an E.
- The warnings are only about the first case; they warn you that
  your backslash characters are interpreted as escape characters even
  though the string is not preceeded by E.

I don't think there's anything special to consider for DBD::Pg.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Scott Ribe
Date:
Subject: Re: numeric field overflow
Next
From: Miklosi Attila
Date:
Subject: Re: connection failure