Re: Where to call SetQuerySnapshot - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Where to call SetQuerySnapshot
Date
Msg-id 3DA22C98.5040908@joeconway.com
Whole thread Raw
In response to Where to call SetQuerySnapshot  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Where to call SetQuerySnapshot
List pgsql-hackers
Tom Lane wrote:
> 1. Where is the cleanest place to call SetQuerySnapshot() for utility
> statements that need it?  Should we follow the lead of the existing
> COPY code, and add the call to the ExecuteStmt case in utility.c?
> Or should we move the calls into the command-specific routines (DoCopy
> and ExecuteQuery)?  Or perhaps it should be done in postgres.c, which
> has this responsibility for non-utility statements?

Without looking at it too closely, I would think postgres.c would be best, 
unless there is a legit reason for a utility statement to *not* want 
SetQuerySnapshot called. If that's the case, then utility.c seems to make sense.

> 2. Would it be a good idea to change CopyQuerySnapshot to elog(ERROR)
> instead of silently creating a snapshot when none has been made?
> I think I was the one who put in its auto-create-snapshot behavior,
> but I'm now feeling like that was a mistake.  It hides omissions that
> we should want to find.

Is an assert appropriate?

Joe



pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: Dirty Buffer Writing [was Proposed LogWriter Scheme]
Next
From: "Ken Hirsch"
Date:
Subject: Re: Proposed LogWriter Scheme, WAS: Potential Large