Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] psql \copy warning

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, Jeremy Drake <pgsql(at)jdrake(dot)com>
Subject: Re: [HACKERS] psql \copy warning
Date: 2006-06-01 05:12:43
Message-ID: 200606010512.k515ChI11030@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> >> I have developed an updated patch that:
> >> 
> >> o  turns off escape_string_warning in pg_dumpall.c
> >> o  optionally use E'' for \password (undocumented option?)
> >> o  honor standard_conforming-strings for \copy (but not
> >> support literal E'' strings)
> >> o  optionally use E'' for \d commands
> >> o  turn off escape_string_warning for createdb, createuser,
> >> droplang
> >> 
> >> I agree someday we might want to turn off escape_string_warning, but I
> >> think we should leave it on as long as possible as it is still pointing
> >> out escape problem areas in the code.
> 
> I find this patch mighty ugly, and hope that most of it can get reverted
> before 8.2.  The changes you made in describe.c are actively broken ...
> didn't you test it?  appendStringLiteralConn doesn't know what you did.

I will look into that.  Thanks.

> I think that a far saner approach would be to make all these places use
> appendStringLiteralConn, and to change *only* that routine to throw on
> an E at need.  That would (a) not be broken, and (b) give us just one
> place to change the behavior when it comes time.

The problem is that pg_dump uses appendStringLiteralConn() too, and you
didn't want pg_dump to emit E'', so you would have to add a boolean to
appendStringLiteralConn() to say whether you want an optional E'' and
that seems even uglier.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

pgsql-hackers by date

Next:From: Hannu KrosingDate: 2006-06-01 05:23:31
Subject: Re: copy with compression progress n
Previous:From: Tom LaneDate: 2006-06-01 01:55:33
Subject: Re: server crash on recursive function invocation

pgsql-patches by date

Next:From: Martijn van OosterhoutDate: 2006-06-01 06:47:06
Subject: Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling
Previous:From: Tom LaneDate: 2006-05-31 22:02:52
Subject: Re: [HACKERS] psql \copy warning

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group