Re: strange test in psql:startup.c

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: strange test in psql:startup.c
Date: 2015-09-03 20:31:22
Message-ID: CA+TgmobZs4nRn10_1tShgDObQPHJMCD-TECahnYT2V7ZPTDdsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 26, 2015 at 8:18 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> if (options.single_txn && options.action != ACT_FILE &&
> options.action == ACT_NOTHING)
> {
> fprintf(stderr, _("%s: -1 can only be used in
> non-interactive mode\n"), pset.progname);
> exit(EXIT_FAILURE);
> }
>
> the expression should be probably only?
>
> options.single_txn && options.action == ACT_NOTHING)

It seems this was changed by this commit:

commit c3c86ae2aff67676a49ec84240f1d6a482f359cb
Author: Peter Eisentraut <peter_e(at)gmx(dot)net>
Date: Mon Jun 17 21:53:33 2013 -0400

psql: Re-allow -1 together with -c or -l

I guess the idea was that we wanted to allow -1 with -c or -l even
though it will have no effect in that case. So your suggested change
looks right to me.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2015-09-03 21:37:09 Re: Freeze avoidance of very large table.
Previous Message Robert Haas 2015-09-03 20:21:55 Re: Autonomous Transaction is back