Thread: 7.4 beta1 plpgsql regression

7.4 beta1 plpgsql regression

From
Rod Taylor
Date:
The below function works in 7.3 (returns nothing, but no errors).

rbttest=# begin;
BEGIN
rbttest=# create or replace function service.test(integer)
rbttest-#   returns setof service.service
rbttest-# as '
rbttest'# declare
rbttest'#   v_service service.service%rowtype;
rbttest'#
rbttest'# begin
rbttest'#
rbttest'#
rbttest'#   return;
rbttest'# end;
rbttest'# ' language plpgsql;
CREATE FUNCTION
rbttest=# select * from service.test(1);
ERROR:  cache lookup failed for type 0
CONTEXT:  compile of PL/pgSQL function "test" near line 2



Re: 7.4 beta1 plpgsql regression

From
Tom Lane
Date:
Rod Taylor <rbt@rbt.ca> writes:
> The below function works in 7.3 (returns nothing, but no errors).

> rbttest=3D# select * from service.test(1);
> ERROR:  cache lookup failed for type 0
> CONTEXT:  compile of PL/pgSQL function "test" near line 2

Hmm, works fine here ...

regression=# create schema service;
CREATE SCHEMA
regression=# create table service.service (f1 int, f2 text);
CREATE TABLE
regression=# create or replace function service.test(integer)
regression-# returns setof service.service
regression-# as '
regression'# declare
regression'#  v_service service.service%rowtype;
regression'# begin
regression'# return;
regression'#  end;
regression'# ' language plpgsql;
CREATE FUNCTION
regression=# select * from service.test(1);f1 | f2
----+----
(0 rows)

regression=#
        regards, tom lane


Re: 7.4 beta1 plpgsql regression

From
Rod Taylor
Date:
I think I have a catalog corruption (self inflicted I'm sure).  A dump /
reload of the database corrects the issue here as well.

On Thu, 2003-08-14 at 08:33, Tom Lane wrote:
> Rod Taylor <rbt@rbt.ca> writes:
> > The below function works in 7.3 (returns nothing, but no errors).
>
> > rbttest=3D# select * from service.test(1);
> > ERROR:  cache lookup failed for type 0
> > CONTEXT:  compile of PL/pgSQL function "test" near line 2
>
> Hmm, works fine here ...
>
> regression=# create schema service;
> CREATE SCHEMA
> regression=# create table service.service (f1 int, f2 text);
> CREATE TABLE
> regression=# create or replace function service.test(integer)
> regression-# returns setof service.service
> regression-# as '
> regression'# declare
> regression'#  v_service service.service%rowtype;
> regression'# begin
> regression'# return;
> regression'#  end;
> regression'# ' language plpgsql;
> CREATE FUNCTION
> regression=# select * from service.test(1);
>  f1 | f2
> ----+----
> (0 rows)
>
> regression=#
>
>             regards, tom lane
>