Re: Read-only transactions
| От | Peter Eisentraut |
|---|---|
| Тема | Re: Read-only transactions |
| Дата | |
| Msg-id | Pine.LNX.4.44.0301081802000.29178-100000@localhost.localdomain обсуждение исходный текст |
| Ответ на | Re: Read-only transactions (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
Tom Lane writes:
> case T_VacuumStmt:
> /* No XactReadOnly check since this logically changes no data */
> vacuum((VacuumStmt *) parsetree);
> break;
>
> Then it'll be hard to miss the need to think about this when adding a
> new statement.
Well, I had one big check at the top so it doesn't have to be spread out
so much:
static void
check_xact_readonly(Node *parsetree)
{if (!XactReadOnly) return;
switch (nodeTag(parsetree)){ case T_AlterDatabaseSetStmt: case T_AlterDomainStmt: case T_AlterGroupStmt:
[...] case T_DropUserStmt: case T_GrantStmt: case T_TruncateStmt: elog(ERROR, "transaction is
read-only"); break;}
}
--
Peter Eisentraut peter_e@gmx.net
В списке pgsql-hackers по дате отправления: