Skip site navigation (1) Skip section navigation (2)

Re: Problem saving some characters

From: jseymour(at)linxnet(dot)com (Jim Seymour)
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Problem saving some characters
Date: 2004-06-21 13:26:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
"=?iso-8859-1?q?Eduardo=20S.=20Fontanetti?=" <dufuzzy(at)yahoo(dot)com(dot)br> wrote:
> Hello,
> I am trying to save a directory name on the Postgres,
> but it is "cutting" some characters, and the result is
> being diferent, and then, my app don't work properly.
> Example:
> I am trying to save "S:\directory\app" to a text field
> on the Postgres.
> When I do a  Select, it returns "S:directoryapp".

That's because back-slashes are escape characters to pgsql.  You need
to escape them (yes: escape the escape chars) in order to get them into
the db.  This also means that anytime you may wish to search on these,
you'll have to properly escape the escapes.  And so-on.

I believe if you thoroughly peruse the docs, you'll find this noted.


In response to

pgsql-admin by date

Next:From: Jouneau LucDate: 2004-06-21 13:26:15
Subject: Re: Problem saving some characters
Previous:From: Eduardo S. FontanettiDate: 2004-06-21 13:04:21
Subject: Problem saving some characters

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group