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;