Dirk Mika <Dirk.Mika@mikatiming.de> writes:
> But when I try to modify a field of a record in the array I get a syntax error.
> l_classes_array[i].field1 := l_value;
> The error is ERROR: syntax error at or near "." Position: 12414 where position points to the . after the [i]. I've no
ideawhat's causing this syntax error.
Yeah, that seems like it ought to work, and ideally it would. But plpgsql
doesn't currently have support for nested field-of-array-element or
element-of-record-field assignments. (I've looked briefly at this in the
past, and it doesn't seem impossible, but it's definitely not trivial
either.)
You'll have to do some kind of workaround like assigning the whole array
element to a temp variable, fixing the field in the temp variable, then
assigning back :-(
regards, tom lane