[postgis-devel] SVN trunk parser modifications stage 2
Mark Cave-Ayland
mark.cave-ayland at siriusit.co.uk
Mon Oct 20 09:27:09 PDT 2008
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.
--
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
More information about the postgis-devel
mailing list