Re: ARRAY vars (was Enable pl/python to return records based on multiple OUT params)

Поиск
Список
Период
Сортировка
Искать
От
David Blewett
Тема
Re: ARRAY vars (was Enable pl/python to return records based on multiple OUT params)
Дата
Msg-id
9d1f8d830811060810h5e023e28x79b04c6262d8d5af@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Enable pl/python to return records based on multiple OUT params Hannu Krosing <hannu@2ndQuadrant.com>
Re: Enable pl/python to return records based on multiple OUT params Hannu Krosing <hannu@2ndQuadrant.com>
Re: Enable pl/python to return records based on multiple OUT params Tom Lane <tgl@sss.pgh.pa.us>
Re: Enable pl/python to return records based on multiple OUT params Hannu Krosing <hannu@2ndQuadrant.com>
Re: Enable pl/python to return records based on multiple OUT params Tom Lane <tgl@sss.pgh.pa.us>
Re: Enable pl/python to return records based on multiple OUT params Tom Lane <tgl@sss.pgh.pa.us>
Re: Enable pl/python to return records based on multiple OUT params Hannu Krosing <hannu@2ndQuadrant.com>
Re: Enable pl/python to return records based on multiple OUT params "Robert Haas" <robertmhaas@gmail.com>
Re: Enable pl/python to return records based on multiple OUT params Hannu Krosing <hannu@2ndQuadrant.com>
Re: Enable pl/python to return records based on multiple OUT params "David Blewett" <david@dawninglight.net>
Re: ARRAY vars (was Enable pl/python to return records based on multiple OUT params) Hannu Krosing <hannu@2ndQuadrant.com>
Re: ARRAY vars (was Enable pl/python to return records based on multiple OUT params) "David Blewett" <david@dawninglight.net>
On Tue, Nov 4, 2008 at 4:17 PM, Hannu Krosing  wrote:
> One open question is how to translate arrays with non-default subscript
> values
>
> Quote: "Subscripted assignment allows creation of arrays that do not use
> one-based subscripts. For example one might assign to myarray[-2:7] to
> create an array with subscript values running from -2 to 7."
>
> Should I just shift it to standard python tuple, or would it be better
> to return it as a dictionary with keys from -2 to 7

I think changing the base type is bound to cause issues. For example,
suppose someone expects to be able to simply iterate over the array.
If they're assuming it's a list, they will expect the values to be
returned. If it's a dictionary, the keys will be. If you're going to
do that, you'd need to do a custom dict class that iterated over the
values I think.

David Blewett

В списке pgsql-hackers по дате отправления
От: Andrew Dunstan
Дата:
От: Tom Lane
Дата:
Сообщение: Re: RAM-only temporary tables
FAQ