Hi,

    seems  to me that psql thinks to know a little too much about
    quoting. I'm not able to qoute a backslash at the  end  of  a
    line:

        xxx=# select 'a\\b\\
        xxx'# c';
         ?column?
        ----------
         a\b
        c
        (1 row)

    There  is  a  newline  following  directly  after  b\\,  so I
    expected a "a\b\<NL>c" response - what  the  above  obviously
    isn't.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



Mon, 17 Jul 2000 19:01:23 +0200 (MEST)
JanWieck@t-online.de (Jan Wieck)
psql eating backslashes
Jan Wieck writes:

>     seems  to me that psql thinks to know a little too much about
>     quoting. I'm not able to qoute a backslash at the  end  of  a
>     line:
> 
>         xxx=# select 'a\\b\\
>         xxx'# c';
>          ?column?
>         ----------
>          a\b
>         c
>         (1 row)

I committed a fix that should give you better results.

peter=# select 'abc\\
peter'# def';
 ?column?
----------
 abc\
def
(1 row)

But what should

peter=# select 'abc\
peter'# def';

do? This doesn't seem right:

 ?column?
----------
 abc
def
(1 row)

Should the newline be stripped?


-- 
Peter Eisentraut                  Sernanders vï¿½g 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Mon, 17 Jul 2000 20:30:38 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: psql eating backslashes
Peter Eisentraut <peter_e@gmx.net> writes:
> But what should

> peter=# select 'abc\
> peter'# def';

> do? This doesn't seem right:

>  ?column?
> ----------
>  abc
> def
> (1 row)

Looks fine to me.

> Should the newline be stripped?

I would think not.  That would mean that backslash-newline gives you
something *other* than a literal newline, which is an inconsistency
we don't need since we don't treat newline as special.

Also, it would be changing the old (pre-7.0) behavior, which would
doubtless break someone's code somewhere.  In the absence of a
compelling reason to change the behavior, I think we have to leave it
alone.

			regards, tom lane

Mon, 17 Jul 2000 17:42:12 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: psql eating backslashes 