pl/pgsql incorrect syntax checking on select .... into ... ?

From: Artiom Makarov <artiom(dot)makarov(at)gmail(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: pl/pgsql incorrect syntax checking on select .... into ... ?
Date: 2014-05-28 12:04:32
Message-ID: CAPDRmz_2y5u2qNzrxJiD2=StopBhynGiZ381c6CM11oL0GTngQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Missed comma in select ... into construction don't raise ERROR both on
compiling and run time.

create table temp_table(i1 int, i2 int, i3 int, i4 int);
insert into temp_table(i1,i2,i3,i4) values (1,2,3,4);

CREATE OR REPLACE FUNCTION test_select_inti()
RETURNS bool AS
$$
declare
var_i1 int;
var_i2 int;
var_i3 int;
var_i4 int;
begin

-- ---- missed comma \/ ----
select i1,i2, i3, i4 into var_i1,var_i2 var_i3, var_i4
from temp_table;

raise notice '%, %, %, %',var_i1,var_i2,var_i3,var_i4;

return true;
end
$$ LANGUAGE plpgsql VOLATILE SECURITY DEFINER;

select test_select_inti();

#NOTICE: 1, 2, <NULL>, <NULL>

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Keith Fiske 2014-05-28 17:28:41 Re: BUG #9652: inet types don't support min/max
Previous Message Dave Page 2014-05-28 11:47:52 Re: Re: [BUGS] BUG #10250: pgAdmin III 1.16.1 stores unescaped plaintext password