BUG #3229: Incorrect temp table work - Mailing list pgsql-bugs

From ALEXEY PARSHIN
Subject BUG #3229: Incorrect temp table work
Date
Msg-id 200704160912.l3G9C48k046754@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #3229: Incorrect temp table work
List pgsql-bugs
The following bug has been logged online:

Bug reference:      3229
Logged by:          ALEXEY PARSHIN
Email address:      alexeyp@gmail.com
PostgreSQL version: 8.1.8
Operating system:   Gentoo Linux
Description:        Incorrect temp table work
Details:

If I call the following function two or more time, I get an error "relation
with OID 318730 does not exist":

CREATE OR REPLACE FUNCTION temp_test(
) RETURNS void AS $$
BEGIN

  BEGIN
    CREATE TEMP TABLE session_info(
      si_person int not null,
      si_person_name varchar(40) not null,
      si_server int not null
    );
  EXCEPTION
    -- Table already exists? Clean it
    WHEN others THEN
      DELETE FROM session_info;
  END;

  INSERT INTO session_info (si_person,si_person_name,si_server)
  VALUES (1,'test',1);

  RAISE EXCEPTION 'Something went wrong';
END;
$$ LANGUAGE 'plpgsql';
----------------------------------------------------------------------------
----
GRANT EXECUTE ON FUNCTION temp_test() TO PUBLIC;

pgsql-bugs by date:

Previous
From: "Kazuhiro Inaoka"
Date:
Subject: BUG #3228: Linux/M32R project
Next
From: "Amorn Buchheit"
Date:
Subject: BUG #3231: Duplicate rows primary key bug