Re: [HACKERS] patches for items from TODO list - Mailing list pgsql-patches

From Tom Lane
Subject Re: [HACKERS] patches for items from TODO list
Date
Msg-id 28122.1117307086@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] patches for items from TODO list  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [HACKERS] patches for items from TODO list
Re: [HACKERS] patches for items from TODO list
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Here is an updated version of the COPY \x patch.  It is the first patch
> attached.
> Also, I realized that if we support \x in COPY, we should also support
> \x in strings to the backend.  This is the second patch.

Do we really want to do any of these things?  We've been getting beaten
up recently about the fact that we have non-SQL-spec string escapes
(ie, all the backslash stuff) so I'm a bit dubious about adding more,
especially when there's little if any demand for it.

I don't object too much to the COPY addition, since that's outside any
spec anyway, but I do think we ought to think twice about adding this
to SQL literal handling.

> Third, I found out that psql has some unusual handling of escaped
> numbers.  Instead of using \ddd as octal, it has \ddd is decimal, \0ddd
> is octal, and \0xddd is decimal.  It is basically following the strtol()
> rules for an escaped value.  This seems confusing and contradicts how
> the rest of our system works.

I agree, that's just going to confuse people.

> ! xqescape        [\\][^0-7x]

If you are going to insist on this, at least make it case-insensitive.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] patches for items from TODO list
Next
From: Michael Paesold
Date:
Subject: Re: [HACKERS] patches for items from TODO list