Re: strange test in psql:startup.c - Mailing list pgsql-hackers

From Robert Haas
Subject Re: strange test in psql:startup.c
Date
Msg-id CA+TgmobZs4nRn10_1tShgDObQPHJMCD-TECahnYT2V7ZPTDdsQ@mail.gmail.com
Whole thread Raw
In response to strange test in psql:startup.c  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Wed, Aug 26, 2015 at 8:18 AM, Pavel Stehule <pavel.stehule@gmail.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@gmx.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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Autonomous Transaction is back
Next
From: Petr Jelinek
Date:
Subject: Re: Freeze avoidance of very large table.