Re: [HACKERS] keeping track of connections - Mailing list pgsql-hackers

From The Hermit Hacker
Subject Re: [HACKERS] keeping track of connections
Date
Msg-id Pine.BSF.3.96.980603184117.388J-100000@thelab.hub.org
Whole thread Raw
In response to Re: [HACKERS] keeping track of connections  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] keeping track of connections  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [HACKERS] keeping track of connections  (Brett McCormick <brett@work.chicken.org>)
Re: [HACKERS] keeping track of connections  (dg@illustra.com (David Gould))
List pgsql-hackers
On Wed, 3 Jun 1998, Bruce Momjian wrote:

> >
> >
> > I would love a way to keep track of the connections/attempted
> > connections to the postmaster.  I'm thinking that when the postmaster
> > accept()s a connection, it can just insert a record into a table
> > (system catalog or not) with the information, which can be updated
> > after the authentication succeeds/fails or whatnot.
> >
> > something like 'smbstatus' for the samba system.
> >
> > So, my question is: how should I go about doing this?  should I look
> > into SPI, which I know nothing about?  or, what..  I don't think the
> > catalog cache stuff needs to be changed, it isn't as if this info
> > needs to be immediately accessible.
>
> Good question.  Postmaster does not have access to the system tables, so
> it can't access them.  You could add a debug option to show it in the
> server logs, or add it to the -d2 debug option that already shows SQL
> statements.

Here's one for you...and don't laugh at me, eh? :)

postmaster starts up to listen for connections, and then starts up its own
backend to handle database queries?  So, on a quiet system, you would have
two processes running, one postmaster, and one postgres...

basically, the idea is that postmaster can't talk to a table, only
postgres can...so, setup postmaster the same way that any other interface
is setup...connect to a backend and pass its transactions through that
way...

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] keeping track of connections
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] keeping track of connections