Re: Escape handling in COPY, strings, psql

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Sergey Ten <sergey(at)sourcelabs(dot)com>, "'Christopher Kings-Lynne'" <chriskl(at)familyhealth(dot)com(dot)au>, jason(at)sourcelabs(dot)com
Subject: Re: Escape handling in COPY, strings, psql
Date: 2005-05-30 09:26:44
Message-ID: 200505301126.45046.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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.

> 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.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2005-05-30 09:32:37 Re: compiling postgres with Visual Age compiler on
Previous Message Hannu Krosing 2005-05-30 09:21:41 Re: compiling postgres with Visual Age compiler on

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-05-30 14:12:19 Re: Escape handling in COPY, strings, psql
Previous Message Ron Mayer 2005-05-30 08:04:48 Re: O_DIRECT for WAL writes