[PyGreSQL] Added a method for getting parameter settings

Christoph Zwerschke cito at online.de
Wed Aug 2 14:00:21 EDT 2006


I have just added a method for getting parameter settings, based on 
PQparameterStatus(). If db is a (_pg level) database connection, then 
you can get the value of parameter 'name' as db.parameter('name'). If no 
parameter 'name' is present, the return value will be None.

So we can now get the value of DateStyle as db.parameter('DateStyle'). 
Note that the name is case sensitive, i.e. 'datestyle' will not work.

Of couse, you can get the same value from the query 'show DateStyle', 
but db.parameter('DateStyle') is faster and simpler.

You will need to download pgmodule.c from CVS and recompile for this.

-- Christoph


More information about the PyGreSQL mailing list