Re: updating elements of an array which is part of a composite type?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Celia McInnis <celia(at)drmath(dot)ca>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: updating elements of an array which is part of a composite type?
Date: 2005-06-01 15:26:53
Message-ID: 20050601152653.GA48409@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Jun 01, 2005 at 09:54:38AM -0500, Celia McInnis wrote:
>
> How do I update the elements of an array when the array is part of a
> composite type?
>
> If I type:
>
> update mytable set (mytype).myarray[1]='whatever' where ...;
>
> I get :
>
> ERROR: syntax error at or near "(" at character ...

Remove the parentheses:

UPDATE mytable SET mytype.myarray[1] = 'whatever' WHERE ...;

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Nick Jones 2005-06-01 15:45:21 Re: Functions
Previous Message Andrew Hammond 2005-06-01 15:08:06 Re: Functions