Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TU2tl-0003Mb-4X for pgsql-bugs@postgresql.org; Thu, 01 Nov 2012 22:06:01 +0000 Received: from globepointer.com ([213.157.92.217]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TU2tf-0001WL-F4 for pgsql-bugs@postgresql.org; Thu, 01 Nov 2012 22:06:00 +0000 Received: from blue.lan (81-237-193-137-no16.tbcn.telia.com [81.237.193.137]) (Authenticated sender: pgmail) by globepointer.com (Postfix) with ESMTP id 59CB2BB25; Fri, 2 Nov 2012 00:05:54 +0200 (EET) Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Tom Lane" Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7635: psql -1 and \connect References: <7960.1351805390@sss.pgh.pa.us> Date: Thu, 01 Nov 2012 23:05:57 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Marko Tiikkaja" Message-ID: In-Reply-To: <7960.1351805390@sss.pgh.pa.us> User-Agent: Opera Mail/12.02 (Win32) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201211/11 X-Sequence-Number: 34569 On Thu, 01 Nov 2012 22:29:50 +0100, Tom Lane wrote: > pgmail@joh.to writes: >> I know it's not clear what to do with --single-transaction if a script >> is >> \connecting to multiple databases in a single file, but IMHO it should >> at >> least work correctly for the single database case. > > Define "correctly" --- I would expect \connect to establish a new > connection even if the same target database is named. We can't change > that behavior without breaking existing scripts, IMO --- for example, \c > is a long-established way to reset GUC settings, prepared statements, > etc. Hmm.. I only considered the case where the \connect is at the beginning of the file. I see your point. > Perhaps we should have \connect fail outright in -1 mode. I can see > no way for it to do anything and still maintain the expectation of a > single transaction. Would supporting a \connect at the very beginning of the file seem possible? Maybe even only if it's to the same database? Regards, Marko Tiikkaja