Re: BUG #7635: psql -1 and \connect

From: "Marko Tiikkaja" <pgmail(at)joh(dot)to>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7635: psql -1 and \connect
Date: 2012-11-01 22:05:57
Message-ID: op.wm37n7a0ye4vw9@blue.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 01 Nov 2012 22:29:50 +0100, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> pgmail(at)joh(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-11-01 22:33:17 Re: BUG #7634: Missing files in global/ after a lot of CREATE DATABASE / DROP DATABASE
Previous Message Tom Lane 2012-11-01 21:29:50 Re: BUG #7635: psql -1 and \connect