Re: BUG #3376: Erro : COMMIT

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Felipe Nogueira <fbnogueira(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3376: Erro : COMMIT
Date: 2007-06-08 13:54:08
Message-ID: 46695F80.9090204@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Felipe Nogueira wrote:
> I have the following function
>
> CREATE OR REPLACE FUNCTION "public"."data" (integer, integer) RETURNS
> integer AS
> $body$
> DECLARE
> vDATA integer;
> BEGIN
> COMMIT;
> END;
> $body$
> LANGUAGE 'plpgsql' STABLE CALLED ON NULL INPUT SECURITY INVOKER;
>
> When I execute i have the error
>
> ERROR: SPI_execute_plan failed executing query "COMMIT":
> SPI_ERROR_TRANSACTION
> CONTEXT: PL/pgSQL function "data" line 4 at SQL statement

You can't commit a transaction inside a function. What were you
expecting to happen?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2007-06-08 14:41:42 Re: [PATCHES] [BUGS] BUG #3326: Invalid lower bound of autovacuum_cost_limit
Previous Message Felipe Nogueira 2007-06-08 13:36:18 BUG #3376: Erro : COMMIT