Re: Documentation on standard conforming strings?

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Preston de Guise *EXTERN*" <preston(at)anywebdb(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Documentation on standard conforming strings?
Date: 2009-10-06 07:00:58
Message-ID: D960CB61B694CF459DCFB4B0128514C203A89824@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2009-10-06 07:01:37 Re: numeric field overflow
Previous Message Scott Marlowe 2009-10-06 06:30:53 Re: numeric field overflow