Re: proposal: row_to_array function

Поиск
Список
Период
Сортировка
Искать
От
Pavel Stehule
Тема
Re: proposal: row_to_array function
Дата
Msg-id
CAFj8pRBxpQb4GAgwaERwZ=BuA1mFi3LHc8ghFC17hzDBCUfK_w@mail.gmail.com
Ответ на
Список
Дерево обсуждения
proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Andrew Dunstan <andrew@dunslane.net>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Jeff Janes <jeff.janes@gmail.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Tom Lane <tgl@sss.pgh.pa.us>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Merlin Moncure <mmoncure@gmail.com>
Re: proposal: row_to_array function Brendan Jurd <direvus@gmail.com>
Re: proposal: row_to_array function Craig Ringer <craig@2ndquadrant.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: proposal: row_to_array function Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: row_to_array function Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: proposal: row_to_array function Merlin Moncure <mmoncure@gmail.com>
Re: proposal: row_to_array function Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: proposal: row_to_array function Merlin Moncure <mmoncure@gmail.com>

2015-01-16 22:35 GMT+01:00 Andrew Dunstan <andrew@dunslane.net>:

On 01/16/2015 12:22 PM, Pavel Stehule wrote:


        There two possible transformations:

        row_to_array --> [[key1, value1],[key2, value2], ...]
        row_to_row_array --> [(key1, value1), (key2, value2), ... ]


    If we're going to go that route, I think it makes more sense to
    create an actual key/value type (ie:
    http://pgxn.org/dist/pair/doc/pair.html) and return an array of that.


ok

    <http://BlueTreble.com>



I think we'd possibly be better off with simply returning a flat array, [key1, value1, ...]

Thats's what the hstore(text[]) and json_object(text[]) functions accept, along with the 2D variant, if we want a precedent.

It can be one of supported variant. I should not be one, because we cannot to simply iterate over it

Next possibility is teach FOREACH to take key and value in one step.

Regards

Pavel
 

cheers

andrew


В списке pgsql-hackers по дате отправления
От: David Johnston
Дата:
От: Pavel Stehule
Дата:
FAQ