Re: \crosstabview fixes - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: \crosstabview fixes
Date
Msg-id 5514314e-d7ed-42d4-b94f-283d129cf8e2@mm
Whole thread Raw
In response to Re: \crosstabview fixes  (Christoph Berg <myon@debian.org>)
List pgsql-hackers
    Christoph Berg wrote:

> > I don't quite see how to work around that, short of simply
> > removing the possibility of addressing columns by their
> > numbers. [...]

> That would be bad news, given that \crosstabview is meant for
> interactive use where these number shortcuts are much more likely to
> be used than in proper production SQL code. Be it only for ease of
> typing, or for the case where the columns are just called ?column?.

Ah, that reminds me that there's another corner case.
In a resultset, two columns can share the exact same name.
I think the only way to distinguish them in that case is
to refer to them by position, so that's another argument
to not discard that possibility.

=# select 'X' as "a", 'Y' as "a", 'Z' \crosstabview a a
Ambiguous column name: a

versus

=# select 'X' as "a", 'Y' as "a", 'x' \crosstabview 1 2a | Y
---+---X | x


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



pgsql-hackers by date:

Previous
From: Bernd Helmle
Date:
Subject: Re: Problems with huge_pages and IBM Power8
Next
From: Jakob Egger
Date:
Subject: Refactor pg_dump as a library?