BUG #13745: Alias notation after WITH ORDINALITY flattens composite types

Поиск
Список
Период
Сортировка
От duncanmgillis@gmail.com
Тема BUG #13745: Alias notation after WITH ORDINALITY flattens composite types
Дата
Msg-id 20151029130725.3019.14923@wrigleys.postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      13745
Logged by:          Duncan Gillis
Email address:      duncanmgillis@gmail.com
PostgreSQL version: 9.4.4
Operating system:   Ubuntu 13.04; Ubuntu 14.04
Description:

With "arr" being an array of some composite type, "UNNEST(arr) WITH
ORDINALITY _(rec, idx)" suprisingly will populate "rec" and "idx" with the
first two elements from each record in array, rather than the entire record
followed by the ordinality of that record.

This seems inconsistent with how the aliasing behaviour works with
subqueries. It also gets very tedious if you need to unpack a composite type
with lots of fields only to have to put it together again in the SELECT
clause:

SELECT ROW(col1, col2, ..., colN)::some_table, row_idx
FROM UNNEST(array_of_rows) WITH ORDINALITY _(col1, col2, ..., colN,
row_idx)

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Re: BUG #13739: Recurring corrupted page pointer panics on hot-standby replica
Следующее
От: kchinnathambu@mdsol.com
Дата:
Сообщение: BUG #13746: SQL Query Window stopped working