accessing postgres conf from stored procedure

Started by strkover 20 years ago4 messages
#1strk
strk@keybit.net

Is it possible to access postgres configuration from
a C stored procedure ?

I need to leverage memory usage and I'd use postgres configuration
rather then a compile-time define.

Is there such a configuration, if access is possible ?

--strk;

#2Dave Cramer
pg@fastcrypt.com
In reply to: strk (#1)
Re: accessing postgres conf from stored procedure

you can use show xxx to show configuration values

http://www.postgresql.org/docs/7.4/interactive/sql-show.html

Dave
On 27-Jun-05, at 6:56 AM, strk wrote:

Show quoted text

Is it possible to access postgres configuration from
a C stored procedure ?

I need to leverage memory usage and I'd use postgres configuration
rather then a compile-time define.

Is there such a configuration, if access is possible ?

--strk;

---------------------------(end of
broadcast)---------------------------
TIP 8: explain analyze is your friend

#3strk
strk@keybit.net
In reply to: Dave Cramer (#2)
Re: accessing postgres conf from stored procedure

On Mon, Jun 27, 2005 at 08:55:50AM -0400, Dave Cramer wrote:

you can use show xxx to show configuration values

http://www.postgresql.org/docs/7.4/interactive/sql-show.html

No direct interface for shared libs ?

--strk;

#4Michael Fuhr
mike@fuhr.org
In reply to: strk (#3)
Re: accessing postgres conf from stored procedure

On Mon, Jun 27, 2005 at 04:37:11PM +0200, strk wrote:

On Mon, Jun 27, 2005 at 08:55:50AM -0400, Dave Cramer wrote:

you can use show xxx to show configuration values

http://www.postgresql.org/docs/7.4/interactive/sql-show.html

No direct interface for shared libs ?

I don't know if it's fair game, but GetConfigOptionByName() (declared
in utils/guc.h) appears to work. Can any of the developers comment
on whether it's appropriate for user-defined code to call this
function?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/