Re: PL/Python adding support for multi-dimensional arrays

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: PL/Python adding support for multi-dimensional arrays
Дата
Msg-id f377b531-838e-9836-f85d-0b2dbb0e6ce9@iki.fi
обсуждение исходный текст
Ответ на Re: PL/Python adding support for multi-dimensional arrays  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: PL/Python adding support for multi-dimensional arrays  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Re: PL/Python adding support for multi-dimensional arrays  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On 10/11/2016 08:56 AM, Pavel Stehule wrote:
> 2016-10-11 7:49 GMT+02:00 Heikki Linnakangas <hlinnaka@iki.fi>:
>
>> Unfortunately there are cases that are fundamentally ambiguous.
>>
>> create type comptype as (intarray int[]);
>> create function array_return() returns comptype[] as $$
>>   return [[[[1]]]];
>> $$ language plpython;
>>
>> What does the function return? It could be two-dimension array of
>> comptype, with a single-dimension intarray, or a single-dimension comptype,
>> with a two-dimension intarray.
>>
>> We could resolve it for simpler cases, but not the general case. The
>> simple cases would probably cover most things people do in practice. But if
>> the distinction between a tuple and a list feels natural to Python
>> programmers, I think it would be more clear in the long run to have people
>> adjust their applications.
>
> I agree. The distinction is natural - and it is our issue, so we don't
> distinguish strongly.

Ok, let's do that then. Here is a patch set that does that. The first is
the main patch. The second patch adds some code to give a hint, if you
do that thing that whose behavior changed. That code isn't very pretty,
but I think a good error message is absolutely required, if we are to
make this change. Does anyone have better suggestions on how to catch
the common cases of that?

Please review. Are the docs and the error messages now clear enough on
this? We'll need a mention in the release notes too, when it's time for
that.

- Heikki


Вложения

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

Предыдущее
От: vinayak
Дата:
Сообщение: Re: New SQL counter statistics view (pg_stat_sql)
Следующее
От: Christoph Berg
Дата:
Сообщение: Re: [PATCH] pg_filedump is broken