Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Make the pg_stat_activity view call a SRF

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Make the pg_stat_activity view call a SRF
Date: 2008-05-07 17:37:51
Message-ID: 20080507193751.2ecb50bf@mha-laptop.hagander.net (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
Tom Lane wrote:
> mha(at)postgresql(dot)org (Magnus Hagander) writes:
> > Make the pg_stat_activity view call a SRF (pg_stat_get_activity()) 
> > instead of calling a bunch of individual functions.
> 
> > This function can also be called directly, taking a PID as an
> > argument, to return only the data for a single PID.
> 
> Hmm, if you really intend the function to be used directly, then
> having to provide the output column list for it is a pretty big
> usability hit. Why not declare it with OUT parameters, instead?

That does sound like a very good idea... I did notice that as being a
problem, but didn't know how to fix it without thinking more :-)
How do I do that in pg_proc.h? Is there some other function that does
this that I can peek at for inspiration?

//Magnus

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2008-05-07 17:46:11
Subject: Re: [NOVICE] encoding problems
Previous:From: Alvaro HerreraDate: 2008-05-07 17:37:02
Subject: Re: [NOVICE] encoding problems

pgsql-committers by date

Next:From: User AchernowDate: 2008-05-07 17:59:36
Subject: libpqtypes - libpqtypes: makefile changes
Previous:From: User AchernowDate: 2008-05-07 17:14:16
Subject: libpqtypes - libpqtypes: enhanced html output from groff2html, fixed

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group