Help with SET TRANSACTION in a function

Поиск
Список
Период
Сортировка
От otis_usenet@yahoo.com (OtisUsenet)
Тема Help with SET TRANSACTION in a function
Дата
Msg-id 5606b639.0202280857.650d39c0@posting.google.com
обсуждение исходный текст
Ответы Re: Help with SET TRANSACTION in a function  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: Help with SET TRANSACTION in a function  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-general
Hello,

I was wondering if anyone here can help.  I could not get any help on
pgsql-sql  nor pgsql-general mailing lists.

I'm having trouble getting functions with SET TRANSACTION ISOLATION
... to parse.

This is the error I'm getting (example function below the error):

=> select simple_fun();
NOTICE:  plpgsql: ERROR during compile of simple_fun near line 3
ERROR:parse error at or near ";"

This is the simple_fun function that is causing the above error:

CREATE FUNCTION simple_fun() RETURNS INTEGER AS '
BEGIN
  SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
  BEGIN;
  RETURN 1;
  END;
END;
' LANGUAGE 'plpgsql';

This is as simple as it gets.
I think my syntax is correct (I checked Practical PostgreSQL
book as well as a number of 7.2 PDF documents, etc.).

Am I missing a secret ingredient here?

Thank you,
Otis

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

Предыдущее
От: svein.skarstein@weather.no (Svein Are)
Дата:
Сообщение: PG 7.1.3, copy from file suddenly goes very slow
Следующее
От: "Colin Taylor"
Дата:
Сообщение: Compiling under Solaris 8