Fix for VACUUM in psql autocommit off

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: Fix for VACUUM in psql autocommit off
Date: 2004-09-19 19:13:42
Message-ID: 00a201c49e7c$c7ee6800$d604460a@zaphod
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

In current cvs (as in version 7.4.5), VACUUM does not work at all in
autocommit=off mode. That is, because psql does not know that VACUUM cannot
be performed inside an transaction.

Even if you do
ROLLBACK; VACUUM;
it will internally issue a ROLLBACK; BEGIN; VACUUM;

I consider this a bug and suggest the attached fix. is_transact_command() in
src/bin/psql/common.c is used to determine if a command is a transaction
modifying command. The diff just adds "vacuum" to those commands, so that
psql will not issue a BEGIN before a VACUUM.

Best Regards,
Michael Paesold

Attachment Content-Type Size
psql-autocommit-vacuum.diff application/octet-stream 389 bytes

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Stephan Szabo 2004-09-19 19:22:57 Re: How to add locale support for each column?
Previous Message Greg Stark 2004-09-19 19:02:28 Re: How to add locale support for each column?