Skip site navigation (1) Skip section navigation (2)

Re: plpgsql doesn't check a number of expressions and number of target variables correctly

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: plpgsql doesn't check a number of expressions and number of target variables correctly
Date: 2012-03-05 20:08:12
Message-ID: CAFj8pRDGjHYVdZbadEMWDxPCih12yF=P13DVHUbbzrjnLYfpmQ@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
2012/3/5 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> Hello
>> I found a plpgsql bug:
>
>> create or replace function fx()
>> returns void as $$
>> declare a int; b int;
>> begin
>>   select 10,20 into a;
>> end;
>> $$ language plpgsql;
>
>> this is bug, or minimally potential source of strange behave.
>
> AFAICS this is intentional --- see the comment in exec_move_row.
>
> In any case, I think tightening it up is more likely to break working
> applications than do anything helpful.

I agree with you about break working application :( But this is good
example what should be checked in CHECK statement.

but it should be bug - it has no sense - no in this form - it is
assign row to scalar.

I found a some mysterious and very difficult identified bugs in one
application based on this behave.

Regards

Pavel

>
>                        regards, tom lane

In response to

pgsql-bugs by date

Next:From: Euler Taveira de OliveiraDate: 2012-03-05 22:40:53
Subject: Re: BUG #6519: Server doesn't listem
Previous:From: Tom LaneDate: 2012-03-05 19:36:17
Subject: Re: plpgsql doesn't check a number of expressions and number of target variables correctly

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group