Re: [webmaster] How to commit/vacuum a batch of delete statements in a postgresql function - Mailing list pgsql-general

From Nava Jyothi
Subject Re: [webmaster] How to commit/vacuum a batch of delete statements in a postgresql function
Date
Msg-id CAEX-0tQA_zigxyQCw-J88_ks65RM_83nu4GxEhH35+cG-Z+Q=A@mail.gmail.com
Whole thread Raw
Responses Re: Re: [webmaster] How to commit/vacuum a batch of delete statements in a postgresql function
List pgsql-general
Hi PostGresSQL Team

Could you advise us on how to commit records in a batch when one is doing batch wise deletion
. I came across http://www.postgresql.org/message-id/60644bymua.fsf@dba2.int.libertyrms.com, but use of vacuum is giving an error as follows from function.
********** Error **********

ERROR: VACUUM cannot be executed from a function or multi-command string
SQL state: 25001

My stored procedure is of the format:

Loop 
exit when <some condition> DELETE from incoming_table where xyz='123'; VACUUM incoming_table; -- or commit; End Loop;



I thank you for the help.
-Nava

pgsql-general by date:

Previous
From: Andres Freund
Date:
Subject: Re: Old source code needed
Next
From: Adrian Klaver
Date:
Subject: Re: Re: [webmaster] How to commit/vacuum a batch of delete statements in a postgresql function