Re: Setting variables equal to elements from an Array

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: cdecarlo <cdecarlo(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Setting variables equal to elements from an Array
Date: 2008-01-10 16:01:46
Message-ID: dcc563d10801100801q266ff7d9n57d53a4d7bd828ef@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jan 9, 2008 8:14 AM, cdecarlo <cdecarlo(at)gmail(dot)com> wrote:
> On Jan 8, 11:35 am, t(dot)(dot)(dot)(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane) wrote:
> >
> > The rest of your message suggests that what you want is not that at all,
> > but to set the other variable to an array that consists of one or moreelements
> > from the original array. You need to be clearer in your own
> > mind about which it is you're doing --- an array of one element is
> > completely different from the element itself.
> >
> > If you use subscripts that include a colon (:), then the result is a
> > sub-array and has to be assigned to a variable that's of the array
> > type. If you don't use a colon then the subscripting operation produces
> > a single value that's of the array element type, and has to be assigned
> > to a variable of that type. You have to use the correct number of
> > subscripts in either case, else you get a NULL, as you found out.
> >
> > regards, tom lane
>
> Tom,
>
> Maybe it's the combination of it being early in the day and that I'm
> not much of a morning person lately, but your reply really pissed me
> off. It came across as though you were 'helping' me from your
> sanctimonious, holier-than-thou high horse, which, and I hope this
> comes across as being clear in your mind, doesn't help.

Wow, I totally didn't get that from his message... It was short and
to the point. That's all I got.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2008-01-10 16:06:33 Re: After Installing a Program I get this error: psql:sql/Pg-database.sql:825: ERROR: language "plpgsql" does not exist
Previous Message Martijn van Oosterhout 2008-01-10 15:57:43 Re: Can I create a TYPE (or DOMAIN) with arguments?