Re: Coding help - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Coding help
Date
Msg-id 4867.1029477021@sss.pgh.pa.us
Whole thread Raw
In response to Coding help  ("Matthew T. O'Connor" <matthew@zeut.net>)
List pgsql-hackers
"Matthew T. O'Connor" <matthew@zeut.net> writes:
> I have gotten as far as having a vacuum daemon created on postmaster startup.
> It's just a fork from the postmaster, cribbed mostly from the stat collector 
> code. 

This will not get you very far, because the stat collector is not a real
backend.  The checkpointer process might be a better example, but it's
not quite a real backend either.  You need to be a real backend to
access shared buffers, locking, etc.

> I don't understand why it thinks I'm in a function,

Because CurrentMemoryContext is not QueryContext (presumably you never
set QueryContext at all).  This is a pretty cheesy test but I can't
think of a better one offhand...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: SET SCHEMA?
Next
From: Tom Lane
Date:
Subject: Re: Open 7.3 issues