pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Inserting a path into Database
4+ messages / 4 participants
[nested] [flat]

* Inserting a path into Database
@ 2007-06-04 20:10  Ranieri Mazili <ranieri.oliveira@terra.com.br>
  0 siblings, 3 replies; 4+ messages in thread

From: Ranieri Mazili @ 2007-06-04 20:10 UTC (permalink / raw)
  To: pgsql-general@postgresql.org; pgsql-sql

Hello,

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');

I appreciate any help
Thanks



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [SQL] Inserting a path into Database
@ 2007-06-04 20:19  Shoaib Mir <shoaibmir@gmail.com>
  parent: Ranieri Mazili <ranieri.oliveira@terra.com.br>
  2 siblings, 0 replies; 4+ messages in thread

From: Shoaib Mir @ 2007-06-04 20:19 UTC (permalink / raw)
  To: Ranieri Mazili <ranieri.oliveira@terra.com.br>; +Cc: pgsql-general@postgresql.org; pgsql-sql

If you are on 8.1 you can use double qoutes ( 'C:\\Program Files\\My
program' ) on in 8.2 you can use the new "backslash_quote (string)"
setting.

You can find help on "backslash_quote (string)" at -->
http://www.postgresql.org/docs/current/static/runtime-config-compatible.html

--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 6/4/07, Ranieri Mazili <ranieri.oliveira@terra.com.br> wrote:
>
> Hello,
>
> 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');
>
> I appreciate any help
> Thanks
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Inserting a path into Database
@ 2007-06-04 20:39  Mario Guenterberg <mg@havelsoft.com>
  parent: Ranieri Mazili <ranieri.oliveira@terra.com.br>
  2 siblings, 0 replies; 4+ messages in thread

From: Mario Guenterberg @ 2007-06-04 20:39 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

On Mon, Jun 04, 2007 at 05:10:48PM -0300, Ranieri Mazili wrote:
>  Hello,
> 
>  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');
> 

Use double quotes. In example c:\\Programme Files\\...

Greetings

-- 
 -----------------------------------------------------
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966                                 |
| Notruf: 0173-277 33 60                              |
| http://www.havelsoft.com                            |
|                                                     |
| Inhaber: Mario Günterberg                           |
| Mützlitzer Strasse 19                               |
| 14715 Märkisch Luch                                 |
 -----------------------------------------------------

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Inserting a path into Database
@ 2007-06-04 21:15  Michael Glaesemann <grzm@seespotcode.net>
  parent: Ranieri Mazili <ranieri.oliveira@terra.com.br>
  2 siblings, 0 replies; 4+ messages in thread

From: Michael Glaesemann @ 2007-06-04 21:15 UTC (permalink / raw)
  To: Ranieri Mazili <ranieri.oliveira@terra.com.br>; +Cc: pgsql-general@postgresql.org; pgsql-sql


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





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2007-06-04 21:15 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-06-04 20:10 Inserting a path into Database Ranieri Mazili <ranieri.oliveira@terra.com.br>
2007-06-04 20:19 ` Shoaib Mir <shoaibmir@gmail.com>
2007-06-04 20:39 ` Mario Guenterberg <mg@havelsoft.com>
2007-06-04 21:15 ` Michael Glaesemann <grzm@seespotcode.net>

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