Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#304 plpgsql: could not determine data type of parameter $1

1.0 Dev Q
closed
None
5
2012-05-07
2012-04-27
Michael Paquier
No

1) Upload file attached from test plpgsql
2) run that:
select * from PField_v1 where pfname = 'PF0_1' order by slotname; --error
3) This one works however:
select * from PField_v1 where pfname = 'PF0_2' order by slotname;

Discussion

  • Data file to run

     
    Attachments
  • -- More simple test case:
    SET enforce_two_phase_commit TO off;
    create temp table foo (f1 int);
    create function blockme() returns int as $$
    declare x int;
    begin
    x := 1;
    insert into foo values(x);
    begin
    x := x + 1;
    insert into foo values(x);
    select count(*) into x from tenk1 a, tenk1 b, tenk1 c;
    exception
    when others then
    raise notice 'caught others?';
    return -1;
    when query_canceled then
    raise notice 'nyeah nyeah, can''t stop me';
    x := x * 10;
    end;
    insert into foo values(x);
    return x;
    end$$ language plpgsql;
    set statement_timeout to 2000;
    select blockme();
    reset statement_timeout;

     
  • -- More simplified test:
    create table foo (f1 int);
    create function test() returns int as $$
    declare x int;
    begin
    x := 1;
    insert into foo values(x);
    begin
    x := x + 1;
    insert into foo values(x);
    end;
    return x;
    end$$ language plpgsql;
    select test();

     
    • status: open --> closed
     
  • The same issue as in commit 8e393db79e43f0a5605fed35d55af8375b4ffe2c is in test, but regression test is fixed by commit 41497f7.