Re: Moving snapshot code around - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: Moving snapshot code around
Date
Msg-id 20080326173742.GC29730@alvh.no-ip.org
Whole thread Raw
In response to Re: Moving snapshot code around  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Moving snapshot code around  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Agreed, it makes a lot more sense considered in this light.  I renamed
> > snapshot.{c,h} into snapmgmt.{c,h}, hopefully making the intent clearer.
>
> I'd have gone with snapmgr.h/c for consistency with existing filenames
> (bufmgr, lmgr, etc).

Doh!  Sorry.  We're at the best time for changing the name, since the
file has no history.  Shall I?

> > One thing I'm unhappy about is that tqual.h needs to be included in
> > heapam.h (which is included just about everywhere) just to get the
> > definition of the HTSU_Result enum, which is a bit useless because it is
> > only used in three switch statements that contain a "default" clause
> > anyway.  I propose changing the result type of heap_update, heap_delete
> > and heap_lock_tuple to a plain int.
>
> I don't like that very much.  What about just moving the HTSU_Result
> enum's declaration somewhere else?  Two possibilities are heapam.h
> itself, or the new snapshot.h file (which'd then have to be included
> by heapam.h, but it seems lightweight enough that that's not too
> terrible).

Well, heapam.h includes a lot of other headers, so it doesn't look a
good candidate to me.  I think snapshot.h is a reasonably good
candidate.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Moving snapshot code around
Next
From: Bruce Momjian
Date:
Subject: Re: Auto Partitioning Patch - WIP version 1