Re: 8.3.5 problem with plpgsql selecting into an array variable

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: raf <raf(at)raf(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 8.3.5 problem with plpgsql selecting into an array variable
Date: 2009-04-06 04:30:39
Message-ID: 10129.1238992239@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

raf <raf(at)raf(dot)org> writes:
> declare
> pay_group_rec pay_group;
> balance decimal(10,2)[];
> begin
> select g.* into pay_group_rec from pay_group g where g.id = pay_group_id;

> select
> sum(p.balance_period[1]),
> sum(p.balance_period[2])
> into
> balance[1],
> balance[2]
> from
> payee p

Sorry, you can't do that ... per the fine manual, the INTO target can be
"a record variable, a row variable, or a comma-separated list of simple
variables and record/row fields". Nothing there about array subscript
expressions.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message raf 2009-04-06 06:06:36 Re: 8.3.5 problem with plpgsql selecting into an array variable
Previous Message raf 2009-04-06 03:49:19 8.3.5 problem with plpgsql selecting into an array variable