Re: PG 7.4 BETA 3: Bug in NULL arrays updating

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: PG 7.4 BETA 3: Bug in NULL arrays updating
Дата
Msg-id 3F71243E.2040906@joeconway.com
обсуждение исходный текст
Ответ на Re: PG 7.4 BETA 3: Bug in NULL arrays updating  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Tom Lane wrote:
> Bertrand Petit <pgsql@phoe.frmug.org> writes:
>>    When updating a NULL cell which is an array of something,
>>setting an adressed member of a non existent array, the value of the
>>cell is not changed.
>
> Assigning to a member of a NULL array has always yielded another NULL
> array.  While I've never been particularly satisfied with that behavior
> either, it has some logical symmetry to it.  What do you think the
> behavior ought to be?  (In particular, if a non-null array should
> result, where do we get its dimensions and subscripts from?)

I think the behavior is correct. An analogy I is text concatenation. If
I concatenate 'a' to NULL::text, I get NULL. But if I concatenate 'a' to
an empty text value, '', I get 'a'.

Similarly if you assign to an element of an empty array, '{}', you get
an array with the one appended element. Not sure if this works pre-7.4
though -- I know I made some changes related to this, but I forget the
exact details.

Joe

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PG 7.4 BETA 3: Bug in NULL arrays updating
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: create temporary sequence and ecpg