Re: Array Question

From: Terry Lee Tucker <terry(at)esc1(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Array Question
Date: 2004-10-30 09:43:04
Message-ID: 200410300543.04094.terry@esc1.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Nevermind, the error was coming from the trigger. If I comment out the line in
the trigger, the second option below, "or updated at a single element", works
from the psql interface. It just doesn't work that way in the trigger code
:o(

On Saturday 30 October 2004 05:35 am, Terry Lee Tucker saith:
> The documentation reads as follows:
> "An array value can be replaced completely:
>
> UPDATE sal_emp SET pay_by_quarter = '{25000,25000,27000,27000}'
> WHERE name = 'Carol';
>
> or updated at a single element:
>
> UPDATE sal_emp SET pay_by_quarter[4] = 15000
> WHERE name = 'Bill';
>
> or updated in a slice:
>
> UPDATE sal_emp SET pay_by_quarter[1:2] = '{27000,27000}'
> WHERE name = 'Carol'; "
>
> I try this simple statement and get the same error:
>
> UPDATE chist SET broker[10] = 195 WHERE code = 'AAATMOUS000';
>
> Any ideas?
> Thanks...
>
> On Friday 29 October 2004 10:07 pm, Tom Lane saith:
> > Terry Lee Tucker <terry(at)esc1(dot)com> writes:
> > > array[x] = <some_value>;
> > >
> > > This will not compile. I get the following error:
> > > ERROR: syntax error at or near "["
> >
> > plpgsql can do this since 7.4. What PG version are you running?
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
> --
> Work: 1-336-372-6812
> Cell: 1-336-363-4719
> email: terry(at)esc1(dot)com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Quote: 60
"Power tempts even the best of men to take liberties with the truth."

--Joseph Sobran

Work: 1-336-372-6812
Cell: 1-336-363-4719
email: terry(at)esc1(dot)com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-10-30 16:58:32 Re: Array Question
Previous Message Terry Lee Tucker 2004-10-30 09:35:41 Re: Array Question