Обсуждение: Documentation on standard conforming strings?

Поиск
Список
Период
Сортировка

Documentation on standard conforming strings?

От
Preston de Guise
Дата:
Hi,

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 realise this is a little vague, but unfortunately, so too is my
understanding based on what I've read in the documentation thus far...

Cheers,

Preston.

Re: Documentation on standard conforming strings?

От
"Albe Laurenz"
Дата:
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