Re: \crosstabview fixes

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Christoph Berg" <myon(at)debian(dot)org>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>,pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: \crosstabview fixes
Date: 2016-04-14 10:10:45
Message-ID: 5514314e-d7ed-42d4-b94f-283d129cf8e2@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 2
a | Y
---+---
X | x

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakob Egger 2016-04-14 10:16:19 Refactor pg_dump as a library?
Previous Message Bernd Helmle 2016-04-14 10:05:39 Re: Problems with huge_pages and IBM Power8