contrib/showguc (was Re: [HACKERS] revised sample SRF C function; proposed SRF API)

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: contrib/showguc (was Re: [HACKERS] revised sample SRF C function; proposed SRF API)
Date: 2002-06-10 01:27:39
Message-ID: 3D04008B.6020504@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Well, we're not doing that; and I see no good reason to make the thing
> be a builtin function at all. Since it's just an example, it can very
> well be a contrib item with a creation script. Probably *should* be,
> in fact, because dynamically created functions are what other people are
> going to be building; an example of how to do it as a builtin function
> isn't as helpful.

Here is a patch for contrib/showguc. It can serve as a reference
implementation for a C function which returns setof composite. It
required some small changes in guc.c and guc.h so that the number of GUC
variables, and their values, could be accessed. Example usage as shown
below:

test=# select * from show_all_vars() where varname = 'wal_sync_method';
varname | varval
-----------------+-----------
wal_sync_method | fdatasync
(1 row)

test=# select show_var('wal_sync_method');
show_var
-----------
fdatasync
(1 row)

show_var() is neither composite nor set returning, but it seemed like a
worthwhile addition. Please apply if there are no objections.

Thanks,

Joe

Attachment Content-Type Size
showguc.2002.06.09.2.patch text/plain 14.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-06-10 03:45:50 Re: Perl build fix attempted
Previous Message Joe Conway 2002-06-10 01:19:24 C&SRF API patch (was Re: [HACKERS] revised sample SRF C function; proposed SRF API)

Browse pgsql-patches by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-06-10 06:21:56 Re: revised sample SRF C function; proposed SRF API
Previous Message Joe Conway 2002-06-10 01:19:24 C&SRF API patch (was Re: [HACKERS] revised sample SRF C function; proposed SRF API)