Re: Where to call SetQuerySnapshot

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Where to call SetQuerySnapshot
Date: 2002-10-08 18:33:03
Message-ID: 3DA324DF.7070106@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> I did this and ended up with a rather long list of statement types that
> might need a snapshot:
>
> elog(DEBUG2, "ProcessUtility");
>
> /* set snapshot if utility stmt needs one */
> /* XXX maybe cleaner to list those that shouldn't set one? */
> if (IsA(utilityStmt, AlterTableStmt) ||
> IsA(utilityStmt, ClusterStmt) ||
> IsA(utilityStmt, CopyStmt) ||
> IsA(utilityStmt, ExecuteStmt) ||
> IsA(utilityStmt, ExplainStmt) ||
> IsA(utilityStmt, IndexStmt) ||
> IsA(utilityStmt, PrepareStmt) ||
> IsA(utilityStmt, ReindexStmt))
> SetQuerySnapshot();
>
> (Anything that can call the planner or might create entries in
> functional indexes had better set a snapshot, thus stuff like
> ReindexStmt has the issue.)
>
> I wonder if we should turn this around, and set a snapshot for all
> utility statements that can't show cause why they don't need one.
> Offhand, TransactionStmt, FetchStmt, and VariableSet/Show/Reset
> might be the only ones that need be excluded. Comments?

It looks like an exclusion list would be easier to read and maintain.

Joe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-10-08 21:41:24 Re: inline newNode()
Previous Message Ron Johnson 2002-10-08 17:42:20 Re: CHAR, VARCHAR, TEXT (Was Large Databases)