Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5C6B5475A09 for ; Tue, 5 Nov 2002 14:21:03 -0500 (EST) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 8048B4759F2 for ; Tue, 5 Nov 2002 14:21:01 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id gA5JKtC29439; Tue, 5 Nov 2002 14:20:55 -0500 (EST) From: Bruce Momjian Message-Id: <200211051920.gA5JKtC29439@candle.pha.pa.us> Subject: Re: Bug in psql's "-R" option? In-Reply-To: <2D92FEBFD3BE1346A6C397223A8DD3FC09206B@THOR.goeci.com> To: Murthy Kambhampaty Date: Tue, 5 Nov 2002 14:20:55 -0500 (EST) Cc: "'pgsql-admin@postgresql.org'" X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/60 X-Sequence-Number: 6248 psql -R controls the record separator for query output, not COPY. --------------------------------------------------------------------------- Murthy Kambhampaty wrote: > There seems to be a bug in psql's -R option (and the -P recordsep= ) > version. I find that whereas the following succeeds: > > /usr/local/pgsql/bin/psql -U xxxx -d xxxx -h xxxx \ > -P format=unaligned -P fieldsep='\t' -P tuples_only \ > -c "select * from tab where yoo='hoo'" | /usr/local/pgsql/bin/psql > -U xxxx -d xxxx -h xxxx \ > -c "copy bar from stdin" > > adding -R '\n' or -P recordsep='\n' or -P recordsep=newline all give an > error that the last field's data is too long for that field's format. > Presently, this seems a bogus option, since the COPY command cannot handle > any record separator except a newline, but the documentation for the "copy > from" command states that '\n' will be parsed as a newline, so this seems a > bug. > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > -- 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, Pennsylvania 19073