Possible temp table bug in PostgreSQL 7.4.7 / 8.0.1

Поиск
Список
Период
Сортировка
От Oliver Siegmar
Тема Possible temp table bug in PostgreSQL 7.4.7 / 8.0.1
Дата
Msg-id 200503141646.20231.o.siegmar@vitrado.de
обсуждение исходный текст
Ответы Re: Possible temp table bug in PostgreSQL 7.4.7 / 8.0.1  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-bugs
Hello,

I've probably found a temp table bug in PostgreSQL (tested with 7.4.7 and
8.0.1 on Linux x86).


Here's a demonstration of the bug:

CREATE FUNCTION testfunction()
RETURNS void
AS '
    BEGIN
        CREATE TEMP TABLE testtable (field int4) ON COMMIT DROP;

        INSERT INTO testtable (field) VALUES (1);

        -- DROP TABLE testtable;

        RETURN;
    END;
' LANGUAGE 'plpgsql';


database=# SELECT testfunction();

 testfunction
--------------

(1 row)

database=# SELECT testfunction();
ERROR:  relation with OID 29308882 does not exist
CONTEXT:  SQL statement "INSERT INTO testtable (field) VALUES (1)"
PL/pgSQL function "testfunction" line 4 at SQL statement


No transaction has been started manually.

If I drop the temporary testtable manually within the PL/pgSQL function,
everything runs fine. Bug or feature? ;-)


Cheers,
Oliver

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Oliver Siegmar"
Дата:
Сообщение: BUG #1546: Temp table isn't deleted at the end of a transaction / ON COMMIT DROP has no effect
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: BUG #1547: CREATE TYPE AS error