Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 815F9B5DC04; Mon, 4 Jul 2011 16:01:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 15098-05-5; Mon, 4 Jul 2011 19:01:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fetter.org (mail.fetter.org [64.81.66.25]) by mail.postgresql.org (Postfix) with ESMTP id 7774DB5DC36; Mon, 4 Jul 2011 16:01:18 -0300 (ADT) Received: by fetter.org (Postfix, from userid 500) id 04025FBC6C4; Mon, 4 Jul 2011 12:01:16 -0700 (PDT) Date: Mon, 4 Jul 2011 12:01:16 -0700 From: David Fetter To: Tom Lane Cc: Steve Haslam , pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [HACKERS] BUG #6083: psql script line numbers incorrectly count \copy data Message-ID: <20110704190116.GE29446@fetter.org> References: <201106291338.p5TDcPTZ012367@wwwmaster.postgresql.org> <2822.1309795332@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2822.1309795332@sss.pgh.pa.us> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201107/20 X-Sequence-Number: 30632 On Mon, Jul 04, 2011 at 12:02:12PM -0400, Tom Lane wrote: > "Steve Haslam" writes: > > ... Apparently, the data read from \copy is incrementing the > > script line number counter? > > Yeah, so it is. That is correct behavior for COPY FROM STDIN, but > not so much for copying from a separate file. > > The attached patch seems like an appropriate fix. However, I'm > unsure whether to apply it to released branches ... does anyone > think this might break somebody's application? No. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate