Re: \crosstabview fixes

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: \crosstabview fixes
Дата
Msg-id bc3a2e99-5030-4466-a248-98c5e9841205@mm
обсуждение исходный текст
Ответ на Re: \crosstabview fixes  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: \crosstabview fixes  (Christoph Berg <myon@debian.org>)
Список pgsql-hackers
    Tom Lane wrote:

> > That would be OK with me; it's certainly less of a hack than what's
> > there now.  (I went back and forth about how much effort to put into
> > dealing with the colon syntax; I think the version I have in my patch
> > would be all right, but it's not perfect.)
>
> Here's a patch along those lines.  Any objections?

There's the issue that it can no longer distinguish between numbers as
column positions and column names that consist entirely of numbers.

For example, before the patch:
=# SELECT 'a' as "4", 'b' as "5", 'x'  \crosstabview "4" "5"4 | b
---+---a | x

After the patch:
=# SELECT 'a' as "4", 'b' as "5", 'x' \crosstabview "4" "5"
\crosstabview: invalid column number: "4"

crosstabview's parseColumnRefs() knows that "4" is a column
name because of the quotes, but once it's replaced by the psql
ident parser, I guess the quotes are removed and the argument
becomes a bare number.

I don't quite see how to work around that, short of simply
removing the possibility of addressing columns by their
numbers. Which maybe is a bit sad for the end user, I'm not
sure, but ISTM that's a logical consequence of abandoning
the dedicated parser for columns.


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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Christoph Berg
Дата:
Сообщение: Re: \crosstabview fixes
Следующее
От: Christoph Berg
Дата:
Сообщение: Re: \crosstabview fixes