Обсуждение: double quote handling?

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

double quote handling?

От
"postgresql"
Дата:
I am running PG 7.2b5 on a Mac OSX (10.1.2) This is my test box at 
home. In the office I run 7.1.3 on SUSE linux.

I did not find in the changes faq any reference to the handling of 
double quotes. In my testing at home I noticed that 7.2 was 
accepting:

update table set col = 'this is a "test"' where col2 = '1800';

Maybe I was wrong, but I thought I had to escape the double quotes. 
Is this a change, or have I been doing a lot of work for naught?

Ted




Re: double quote handling?

От
Peter Eisentraut
Дата:
postgresql writes:

> I did not find in the changes faq any reference to the handling of
> double quotes. In my testing at home I noticed that 7.2 was
> accepting:
>
> update table set col = 'this is a "test"' where col2 = '1800';
>
> Maybe I was wrong, but I thought I had to escape the double quotes.

You were wrong.  Sorry. ;-)

(Don't confuse double quotes within single-quoted string literals with
double-quoted identifiers, within which you have to escape double quotes.)

-- 
Peter Eisentraut   peter_e@gmx.net