[postgis-devel] SVN trunk parser modifications stage 2

Kevin Neufeld kneufeld at refractions.net
Tue Oct 21 14:04:12 PDT 2008


Having a new variable in the custom_variable_classes list sounds like a 
good idea.

So, does this mean that we will be able to set the parser level for the 
duration of the transaction? Or can this only be set for the duration of 
the session?

SET LOCAL postgis.default_parser_check_level TO 0;
-- or equivalently,
SELECT set_config('postgis.default_parser_check_level', '0', true);

Cheers,
Kevin

Mark Cave-Ayland wrote:
> Obe, Regina wrote:
> 
>> I was thinking about that myself how hard to get into postgresql.conf, 
>> but aren't only products baked into PostgreSQL allowed that luxury or 
>> can third-party products register their own config variables?
> 
> Adding our own variables to postgresql.conf is simple, although we do 
> need to make sure that we can handle the case where the variable doesn't 
> exist. I like this idea since it means that not only can you set the 
> parameter on a global level, but you can override it on a per-role basis 
> so you can have different settings for each database user.
> 
> Similarly, I realise from Kevin's email that I've not been thinking 
> about the possibility of mulitple levels of checking involved from no 
> checks to GEOS-validated checks.
> 
> With this feedback in mind, I'm now thinking something along the lines 
> of this:
> 
> 
> - Add a new value "postgis" to the custom_variable_classes list in 
> postgresql.conf
> 
> - Allow a new parameter "postgis.default_parser_check_level" in 
> postgresql.conf. The proposed values for this parameter are:
> 
>     0 - No checking; all checks are disabled
>     1 - OGC level checking; check for minimum numbers of points and
>         closure of polygons
>     2 - GEOS level validation; check input geometries are valid as
>         per the GEOS IsValid() function
> 
> The first time the parser/unparser is invoked then we check to see if 
> this setting is present; if it is then the current parser check level is 
> set this value. Otherwise a default value of 1 is chosen.
> 
> - Implement a stored procedure to allow the current check level to be 
> altered on the fly for the remainder of the session:
> 
>     SELECT postgis_set_parser_check_level(X);
> 
> and similarly to read the current check level:
> 
>     SELECT postgis_get_parser_check_level();
> 
> 
> This should enable people to set the global defaults in postgresql.conf 
> if required, but also allow the setting to be overridden on-the-fly for 
> the remainder of the session. Does that sound more reasonable?
> 
> 
> ATB,
> 
> Mark.
> 



More information about the postgis-devel mailing list