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-08 09:00:09
Message-ID: 20080508110009.623b13bd@mha-laptop.hagander.net (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > Tom Lane wrote:
> >> 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?
> 
> Sure, see pg_timezone_abbrevs(), pg_timezone_names().
> 
> (This only started to work recently, which is why we have so many
> record-returning functions that don't do it that way.  It might be
> an idea to fix them all sooner or later.)

Wow, that was easy. Not sure where I got the impression it was hard
from - probably last looked at it before it was made easy, and didn't
re-check :-)

Updated the pg_stat_get_activity() function to use this.

And yes, I agree that it's probably a very good idea to go over our
other SRFs and fix them all. I can take a look at that eventually, but
for now I think we stick it on the TODO?

//Magnus


In response to

Responses

pgsql-hackers by date

Next:From: Zoltan BoszormenyiDate: 2008-05-08 09:56:28
Subject: Re: Auto-updated fields
Previous:From: Achilleas MantziosDate: 2008-05-08 07:09:48
Subject: dbmirror - migration to 8.3 from 7.4

pgsql-committers by date

Next:From: User AchernowDate: 2008-05-08 11:30:12
Subject: libpqtypes - libpqtypes: removed libpqtypes.h comments since they are
Previous:From: Magnus HaganderDate: 2008-05-08 08:59:00
Subject: pgsql: Make the new pg_stat_get_activity use OUT parameters, so you

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