Re: Inserting a path into Database

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Inserting a path into Database
Дата
Msg-id 404C8822-2316-42F2-96D0-B89EFDC5F0F7@seespotcode.net
обсуждение исходный текст
Ответ на Inserting a path into Database  (Ranieri Mazili <ranieri.oliveira@terra.com.br>)
Список pgsql-general
On Jun 4, 2007, at 15:10 , Ranieri Mazili wrote:

> I need to insert a path into a table, but because "\" I have a
> error by postgres, so how can I insert a path like bellow into a
> table:
>
> insert into production values ('C:\Program Files\My program');

In v8.0 and later you can use dollar-quoted strings, e.g.,

select $_$C:\Program Files\My program$_$;
           ?column?
-----------------------------
C:\Program Files\My program

http://www.postgresql.org/docs/8.2/interactive/sql-syntax-
lexical.html#SQL-SYNTAX-DOLLAR-QUOTING

For 8.2, you can turn on standard_conforming_strings in
postgresql.conf so \ will be treated literally:

http://www.postgresql.org/docs/8.2/interactive/runtime-config-
compatible.html#GUC-STANDARD-CONFORMING-STRINGS

Michael Glaesemann
grzm seespotcode net



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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Transactional DDL
Следующее
От: Erwin Brandstetter
Дата:
Сообщение: Re: SELECT from mytbl;