pl/pgsql incorrect syntax checking on select .... into ... ? - Mailing list pgsql-bugs

From Artiom Makarov
Subject pl/pgsql incorrect syntax checking on select .... into ... ?
Date
Msg-id CAPDRmz_2y5u2qNzrxJiD2=StopBhynGiZ381c6CM11oL0GTngQ@mail.gmail.com
Whole thread Raw
Responses Re: pl/pgsql incorrect syntax checking on select .... into ... ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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>

pgsql-bugs by date:

Previous
From: yosxpe23
Date:
Subject: Re: BUG #8470: 9.3 locking/subtransaction performance regression
Next
From: Keith Fiske
Date:
Subject: Re: BUG #9652: inet types don't support min/max