Re: [INTERFACES] confused about backslashes

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: Frank Morton <fmorton(at)mail(dot)base2inc(dot)com>
Cc: "pgsql-interfaces(at)postgresql(dot)org" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: [INTERFACES] confused about backslashes
Date: 1998-09-08 17:13:19
Message-ID: Pine.LNX.3.96.980908180445.493G-100000@maidast.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Tue, 8 Sep 1998, Frank Morton wrote:

> can someone help me out here.
>
> I want to put the real text data of "\\QM_RIP1\HEIDEL41"
> in a text field.
>
> If I put double backslashes representing one backslash
> in an insert statement as in "\\\\QM_RIP1\\HEIDEL41"
> and then do a select on that field with psql, I actually see
> the double backslashes (unexpected). But, if i do a query
> using JDBC, it does correctly revert to the single backslash
> I originally was after. I still don't follow this, but it works, so
> I could just ignore it.

JDBC simply returns what the backend sends it, so it should return the
single backslash.

PSQL however, postprocesses it so that you could pipe it back. This is the
behaviour I assumed pg_dump would use.

> However, then i I do a dump of the database with "pg_dump -d",
> this same field comes back out with single backslashes, which
> if you pipe as input to psql to reload, the field is missing the
> backslashes again.

Thinking about this, I think I'd better test JDBC on quoting, in case it
suffers from this problem when updating a table.

--
Peter T Mount peter(at)retep(dot)org(dot)uk
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
Java PDF Generator: http://www.retep.org.uk/pdf

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Gerald Gryschuk 1998-09-08 17:56:17 Win16 psqlodbc possible?
Previous Message david toribio 1998-09-08 15:56:10 wint95<----->psql