Re: [INTERFACES] confused about backslashes - Mailing list pgsql-interfaces

From Peter T Mount
Subject Re: [INTERFACES] confused about backslashes
Date
Msg-id Pine.LNX.3.96.980908180445.493G-100000@maidast.retep.org.uk
Whole thread Raw
In response to confused about backslashes  ("Frank Morton" <fmorton@mail.base2inc.com>)
List 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@retep.org.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


pgsql-interfaces by date:

Previous
From: Gerald Gryschuk
Date:
Subject: Win16 psqlodbc possible?
Next
From: Josh Friess
Date:
Subject: Linking C++ object files with libpq++ libraries