Re: Read-only transactions - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Read-only transactions
Date
Msg-id Pine.LNX.4.44.0301081802000.29178-100000@localhost.localdomain
Whole thread Raw
In response to Re: Read-only transactions  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: python interface
Next
From: Tom Lane
Date:
Subject: Re: Is the 7.3.1 geometry regression test supposed to pass perfectly on Solaris 8 x86?