Re: Escape handling in COPY, strings, psql - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Escape handling in COPY, strings, psql
Date
Msg-id 200505301428.j4UESH210277@candle.pha.pa.us
Whole thread Raw
In response to Re: Escape handling in COPY, strings, psql  (Peter Eisentraut <peter_e@gmx.net>)
Responses Backslash handling in strings  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > I was suggesting ESCAPE 'string' or ESC 'string'.  The marker has to
> > be before the string so scan.l can alter its processing of the string
> > --- after the string is too late --- there is no way to undo any
> > escaping that has happened, and it might already be used by gram.y.
> 
> That pretty much corresponds to my E'string' proposal.  Both are 
> probably equally trivial to implement.

Right.  I think your E'' idea has the benefit of fitting with our
existing X'' and B'' modifiers.  It is also simpler and cleaner to do in
scan.l, so I think your idea is best.

> > I agree with Tom that COPY has to be left unchanged.  The fundamental
> > problem is the representation of NULL values, that I don't think we
> > can do without some escape mechanism.  Single-quote escapes works by
> > doubling them, but once you need to represent something more like
> > null's, I can't think of a solution without escapes.
> 
> Yes, I now realize that COPY has a whole set of different rules anyway, 
> so we can leave that out of this discussion.

Cool.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Escape handling in COPY, strings, psql
Next
From: Greg Stark
Date:
Subject: Re: Escape handling in COPY, strings, psql