Re: [HACKERS] Indirect assignment code for array slices is dead code?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Indirect assignment code for array slices is dead code?
Дата
Msg-id 4266.1489197588@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [HACKERS] Indirect assignment code for array slices is dead code?  (Andres Freund <andres@anarazel.de>)
Ответы Re: [HACKERS] Indirect assignment code for array slices is dead code?
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> In the context of my expression evaluation patch, I was trying to
> increase test coverage of execQual.c.  I'm a bit confused about
> $subject.  ExecEvalArrayRef() has the following codepath:

I think it may indeed be unreachable at present, because we don't support
something like this:

regression=# create table tt (f1 complex[]);
CREATE TABLE
regression=# update tt set f1[2:3].r = array[7,11];
ERROR:  cannot assign to field "r" of column "f1" because its type complex[] is not a composite type
LINE 1: update tt set f1[2:3].r = array[7,11];                     ^

regression=# update tt set f1[2:3].r = array[7,11];
ERROR:  cannot assign to field "r" of column "f1" because its type complex[] is not a composite type
LINE 1: update tt set f1[2:3].r = 42;                     ^

I would not like to remove it though.  This particular bit of the executor
has no business making assumptions about how array and field references
can be nested.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] How to get the 'ctid' from a record type?
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Indirect assignment code for array slices is dead code?