Bug #710: Fail To Create/Drop Temporary Table IN PL/PGSQL

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #710: Fail To Create/Drop Temporary Table IN PL/PGSQL
Дата
Msg-id 20020712011324.E1C4D475914@postgresql.org
обсуждение исходный текст
Ответы Re: Bug #710: Fail To Create/Drop Temporary Table IN PL/PGSQL  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-bugs
CNLIOU (cnliou@eurosport.com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Fail To Create/Drop Temporary Table IN PL/PGSQL

Long Description
Hi!

In TODO list, it reads in sub section

"Fix problems with complex temporary table creation/destruction without using PL/PgSQL EXECUTE, needs cache
prevention/invalidation"

in section "SERVER-SIDE LANGUAGES".

According to this statement, I am in the impression that I can create/destruct temporary table with "execute"
statement,but actually I can't.
 

Perhaps this can be added to TODO list, too.

Also, being unable to use temporary table in PL/PGSQL, I can not proceed working on part of my project.

Best Regards,

CN

Sample Code
CREATE FUNCTION test() RETURNS BOOLEAN AS '
DECLARE
  n INTEGER;
BEGIN
  EXECUTE ''CREATE TEMP TABLE temp1 (MyField INTEGER)'';
  INSERT INTO temp1 VALUES(8);

  SELECT MyField INTO n FROM temp1 LIMIT 1;
  RAISE NOTICE ''%'',n;

  EXECUTE ''DROP TABLE temp1'';
  RETURN TRUE;
END;' LANGUAGE 'plpgsql';

database=# select test();
NOTICE:  8
 test
------
 t
(1 row)

database=# select test();
NOTICE:  Error occurred while executing PL/pgSQL function test
NOTICE:  line 5 at SQL statement
ERROR:  Relation 1118219 does not exist

No file was uploaded with this report

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

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #709: PL/pgSQL Parameter Of Composite Type
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 7.2.1 backend crash (convert_string_datum, locale)