From: Michael Glaesemann <grzm@seespotcode.net>
To: Ranieri Mazili <ranieri.oliveira@terra.com.br>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: Inserting a path into Database
Date: Mon, 4 Jun 2007 16:15:21 -0500
Message-ID: <404C8822-2316-42F2-96D0-B89EFDC5F0F7@seespotcode.net> (raw)
In-Reply-To: <466471C8.40506@terra.com.br>
References: <466471C8.40506@terra.com.br>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: grzm@seespotcode.net, ranieri.oliveira@terra.com.br, pgsql-general@postgresql.org
Subject: Re: Inserting a path into Database
In-Reply-To: <404C8822-2316-42F2-96D0-B89EFDC5F0F7@seespotcode.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox