Обсуждение: strange test in psql:startup.c

Поиск
Список
Период
Сортировка

strange test in psql:startup.c

От
Pavel Stehule
Дата:
Hi

        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)

Regards

Pavel

Re: strange test in psql:startup.c

От
Robert Haas
Дата:
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