Re: Fix for VACUUM in psql autocommit off

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fix for VACUUM in psql autocommit off
Дата
Msg-id 20944.1095623286@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Fix for VACUUM in psql autocommit off  ("Michael Paesold" <mpaesold@gmx.at>)
Список pgsql-patches
"Michael Paesold" <mpaesold@gmx.at> writes:
> 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.
> I consider this a bug and suggest the attached fix.

If we're going to do that, we should also include the other statements
that disallow execution in a transaction, and we should rename
is_transact_command to something more appropriate (not to mention fix
its comments).  A quick grep shows

/home/postgres/pgsql/src/backend/commands/dbcommands.c: 95:     PreventTransactionChain((void *) stmt, "CREATE
DATABASE");
/home/postgres/pgsql/src/backend/commands/dbcommands.c: 497:     PreventTransactionChain((void *) dbname, "DROP
DATABASE");
/home/postgres/pgsql/src/backend/commands/cluster.c: 175:         PreventTransactionChain((void *) stmt, "CLUSTER");
/home/postgres/pgsql/src/backend/commands/indexcmds.c: 995:     PreventTransactionChain((void *) dbname, "REINDEX
DATABASE");
/home/postgres/pgsql/src/backend/commands/vacuum.c: 262:         PreventTransactionChain((void *) vacstmt, stmttype);
/home/postgres/pgsql/src/backend/commands/tablespace.c: 221:     PreventTransactionChain((void *) stmt, "CREATE
TABLESPACE");
/home/postgres/pgsql/src/backend/commands/tablespace.c: 407:     PreventTransactionChain((void *) stmt, "DROP
TABLESPACE");

Handling the multi-keyword cases is going to take a nontrivial increment
of functionality.  Perhaps while we're at it, we could teach this code
about nested /* comments ...

            regards, tom lane

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

Предыдущее
От: "Michael Paesold"
Дата:
Сообщение: Fix for VACUUM in psql autocommit off
Следующее
От: "Michael Paesold"
Дата:
Сообщение: Re: Fix for VACUUM in psql autocommit off