Обсуждение: psql --csv and other parameters

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

psql --csv and other parameters

От
Erik Rijkers
Дата:
I don't know if this really is a bug but it seems wrong to me:

psql -A --csv -Xc "select * from pg_namespace order by 1"

gives a difference result than

psql --csv -A -Xc "select * from pg_namespace order by 1"


I would say both should give the same result, and
that result should be the same as from:

psql --csv -Xc "select * from pg_namespace order by 1"


Thanks,

Erik Rijkers




Re: psql --csv and other parameters

От
"Daniel Verite"
Дата:
    Erik Rijkers wrote:

> I don't know if this really is a bug but it seems wrong to me:
>
> psql -A --csv -Xc "select * from pg_namespace order by 1"
>
> gives a difference result than
>
> psql --csv -A -Xc "select * from pg_namespace order by 1"

-A and --csv each select an output format, and since
there can be only one output format active, they are
mutually exclusive.

When options conflict, the rightmost on the command line wins,
so -A --cvs is the same as --csv, and --csv -A is the same as -A


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


Re: psql --csv and other parameters

От
Michael Paquier
Дата:
On Wed, Nov 28, 2018 at 02:38:04PM +0100, Daniel Verite wrote:
> -A and --csv each select an output format, and since
> there can be only one output format active, they are
> mutually exclusive.
>
> When options conflict, the rightmost on the command line wins,
> so -A --cvs is the same as --csv, and --csv -A is the same as -A

And that's what I would expect.  A lot of folks like using aliases and
relying on the last option being defined as a winner instead of bumping
into an error if multiple overlapping options are defined.
--
Michael

Вложения