Re: What characters need to be quoted?

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: What characters need to be quoted?
Дата
Msg-id 200209122102.34396.list-pgsql-general@empires.org
обсуждение исходный текст
Ответ на What characters need to be quoted?  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Список pgsql-general
> Are there any characters besides the single quote that need to be
> escaped when inserting into PostgresQL?

Also escape backslashes, and the NUL byte (0x00), in addition to the single
quote.

Note that bytea will nicely format output into printable text with escape
codes for the unprintable characters. The text types (char,varchar,text)
aren't as nice about that, and you might end up with unprintable characters
if you store them in that type.

> And am I right in thinking that the SQL standard calls for putting one
> single quote in front of a single quote to escape it (and not use a
> backslash as some other DBs would have you do?)

I believe that either two single quotes or a backslash and a single quote are
the same in PostgreSQL.

Regards,
    Jeff

В списке pgsql-general по дате отправления:

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: Mailing lists archive search
Следующее
От: Justin Clift
Дата:
Сообщение: An opportunity to prove PostgreSQL and our requirement of Case Study info