Re: Insertion of geometric type column with column[0], column[1] and etc.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Insertion of geometric type column with column[0], column[1] and etc.
Дата
Msg-id 14397.1286251864@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Insertion of geometric type column with column[0], column[1] and etc.  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Insertion of geometric type column with column[0], column[1] and etc.  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Yeah, but isn't the current behavior awfully flaky?

The reason the particular case acts so oddly is there's no such thing as
half a point: you can't have a point with one null and one non-null
component.  So there's no way to construct the value incrementally,
which is what that syntax implies doing.  What actually happens is that
"foo[0] := something" results in a NULL point if the initial value of
foo was NULL, and then the same again for "foo[1] := something".
I suppose we could have these cases throw an error instead, but that's
not a lot better from the standpoint of functionality ... and I
certainly don't wish to try to introduce partially-null point values.

In general this shows the limitations of trying to pretend that complex
data types are arrays.  Even if you can manage to find some kind of
mapping, it's not necessarily one-to-one, nor are all the values that
might be valid from one viewpoint valid from the other.  So I've got no
enthusiasm for the OP's proposal.
        regards, tom lane


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

Предыдущее
От: KaiGai Kohei
Дата:
Сообщение: Re: Bug / shortcoming in has_*_privilege
Следующее
От: Tom Lane
Дата:
Сообщение: Re: is sync rep stalled?