pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedconfused about backslashes
3+ messages / 3 participants
[nested] [flat]
* confused about backslashes
@ 1998-09-08 14:08 Frank Morton <fmorton@mail.base2inc.com>
0 siblings, 1 reply; 3+ messages in thread
From: Frank Morton @ 1998-09-08 14:08 UTC (permalink / raw)
To: pgsql-interfaces
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.
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.
Could someone explain this to me.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [INTERFACES] confused about backslashes
@ 1998-09-08 17:13 Peter T Mount <peter@retep.org.uk>
parent: Frank Morton <fmorton@mail.base2inc.com>
0 siblings, 0 replies; 3+ messages in thread
From: Peter T Mount @ 1998-09-08 17:13 UTC (permalink / raw)
To: Frank Morton <fmorton@mail.base2inc.com>; +Cc: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* confused about backslashes
@ 1998-09-16 18:42 Apyo s.r.o. <apyo@apyo.sk>
0 siblings, 0 replies; 3+ messages in thread
From: Apyo s.r.o. @ 1998-09-16 18:42 UTC (permalink / raw)
To: pgsql-interfaces
In psql:
insert into ta (a) values ('\\');
select * from ta;
returns
a
-----------
\\
(1 row)
I would expect
a
-----------
\
(1 row)
And also odbc on win is confused about this backslashes. According to
previous discussions also jdbc is confused about this. I've followed
previous discussion but nobody said that it's a bug of backend. Or or it
isn't? So then it's a bug of psql, odbc and jdbc. Could somebody say a
conclusion who should fix it?
I've seen a patch for odbc but if it's a bug of backend I think it
should be fixed in backend. Maybe it's a feature so all others should
modify their code to work well with this. But still I think that it
wasn't so in previous versions of backend and that's why all interfacing
applications expect now \ while backend returns \\. (or it doesn't ?)
I'm just a beginning user of postgresql. If you got feeling that I don't
understand a word of what I've written above, maybe you're right. I just
would like to update my linked tables in M$ACCE$ and is doesn't work.
It's not possible to change a varchar field at all. Could somebody help?
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~1998-09-16 18:42 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-09-08 14:08 confused about backslashes Frank Morton <fmorton@mail.base2inc.com>
1998-09-08 17:13 ` Peter T Mount <peter@retep.org.uk>
1998-09-16 18:42 confused about backslashes Apyo s.r.o. <apyo@apyo.sk>
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