Re: Update a composite nested type variable

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Update a composite nested type variable
Дата
Msg-id 1373310085989-5763082.post@n5.nabble.com
обсуждение исходный текст
Ответ на Update a composite nested type variable  (Luca Vernini <lucazeo@gmail.com>)
Ответы Re: Update a composite nested type variable  (Luca Vernini <lucazeo@gmail.com>)
Список pgsql-sql
Luca Vernini wrote
> I'm writing a system with havy use of composite types.
> I have a doubt.
> 
> I'm writing all in functions with language plpgsql.
> When I read a field from a composite type I must write something like
> this:
> status = ((in_customer.customer_data).customer_status).status_id
> 
> And this works fine. I need to enclose the base type, but this is not a
> problem.
> 
> When I need to assign a value I try to write something like:
> (in_customer.customer_data).field_a := NULL;
> 
> But postgresql rise an error:
> ERROR: syntax error at or near "("
> SQL state: 42601
> 
> If I dont use parentesis I rise a different error:
> 
> ERROR: "in_customer.customer_data.field_a" is not a known variable
> SQL state: 42601
> 
> 2 questions:
> Why is the behavior so different in read and in assign.
> How can I workaround this and update my values?
> 
> Luca.

This may be a pl/pgsql limitation but you should probably provide a complete
self-contained example with your attempt so that user-error can be
eliminated.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Update-a-composite-nested-type-variable-tp5763023p5763082.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



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

Предыдущее
От: Luca Vernini
Дата:
Сообщение: Update a composite nested type variable
Следующее
От: Luca Vernini
Дата:
Сообщение: Re: Update a composite nested type variable