Re: [PATCH] Exorcise "zero-dimensional" arrays

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: [PATCH] Exorcise "zero-dimensional" arrays
Дата
Msg-id m2ehevqo5m.fsf@2ndQuadrant.fr
обсуждение исходный текст
Ответ на Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: [PATCH] Exorcise "zero-dimensional" arrays  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> I understand, but I don't agree. W have to fix impractical design of
> arrays early. A ARRAY is 1st class - so there is not possible to use
> varchar2 trick.
>
> if we don't would to use GUC, what do you think about compatible
> extension? We can overload a system functions behave. This can solve a
> problem with updates and migrations.

In Common Lisp arrays are multi-dimensional too, and the 1-D arrays have
a specific name, they call them vectors. If you create an array with
only 1 dimension, then it's a vector. All the array API works the same
on vectors.

I guess we could specialize some of our API on vectors and avoid having
to tell the system which dimension we are interested into when using
them rather than multi-dimensional arrays.

Now from the internals perspective I also guess we don't want to be
generating so many more types so maybe we would need some tricks to know
how to promote a 1-D array into a vector automatically?

-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Hash Join cost estimates
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Allow external recovery_config_directory