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

BUG #1059: Second Call of a PGSQL-function fails

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1059: Second Call of a PGSQL-function fails
Date: 2004-01-21 21:24:43
Message-ID: 20040121212443.382F3CF4CD2@www.postgresql.com (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1059
Logged by:          Wilhelm

Email address:      wilhelm(dot)pakulla(at)gmx(dot)de

PostgreSQL version: 7.4

Operating system:   Linux

Description:        Second Call of a PGSQL-function fails 

Details: 

-- The Source:

-- Init Stuff
DROP FUNCTION plpgsql_call_handler () CASCADE;
CREATE FUNCTION plpgsql_call_handler () RETURNS LANGUAGE_HANDLER AS
'$libdir/plpgsql' LANGUAGE C;

CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql
    HANDLER plpgsql_call_handler;

-- The function

CREATE FUNCTION f (INTEGER) RETURNS INTEGER
AS '
BEGIN
  CREATE TABLE test ( x INTEGER );

  -- Without this insert, everything works well...
  INSERT INTO test VALUES (1);

  DROP TABLE test CASCADE;

  RETURN 0;
END;
' LANGUAGE 'plpgsql';

-- That works.
SELECT f(1);

-- Second Call fails.
SELECT f(1);

-- Thanks in advance, Wilhelm



Responses

pgsql-bugs by date

Next:From: Richard HuxtonDate: 2004-01-22 02:02:36
Subject: Re: BUG #1059: Second Call of a PGSQL-function fails
Previous:From: Tom LaneDate: 2004-01-21 19:59:21
Subject: Re: Readline lib configure error. Help

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