[postgis-devel] Valid SRIDs

Stephen Frost sfrost at snowman.net
Thu Jun 26 04:02:18 PDT 2008


* Kevin Neufeld (kneufeld at refractions.net) wrote:
> Not to long ago in the bug tracker, a user suggested that  
> ST_AddGeometryColumns() should error out if the supplied SRID is not in  
> spatial_ref_sys. 

I'm not convinced that's the best approach, though I can understand the
desire to have FKs, etc.

> What does the team here think?  Should PostGIS be responsible for  
> ensuring correct parameters?  (We currently raise exceptions for all  
> other invalid parameters). If so, the solutions I see are:
> 1. Modify the plpgsql function to error if the SRID does not exist
> 2. Put a foreign key constrain on geometry_columns referencing  
> spatial_ref_sys.

Things, in my view anyway, get a fair bit more complicated when you
consider the changes we've been talking about to use PG's user-defined
typmods.  It feels like it'd be 'awkward' to enforce that check in the
typmod and would also mean, I believe, more difficulty when dealing with
dump/restores unless things are done in the right order.

I guess I just don't like the idea of having the addition of a column to
a table using the 'ALTER TABLE ... ADD COLUMN' syntax fail for a
less-than-critical error.  I'm also not a fan of having that code have
to go look up in a table what the valid values are, performance and
locking issues being my concern there.

On the other hand, I do feel differently about ST_AddGeometryColumns(),
and wouldn't be against adding a check in that function, possibly
capable of being overriden.  Adding such a check there strikes me as
less 'invasive' if you will, though if we add it there and people start
to depend on it, they'll be upset if we yank it out later when we move
to using user-defined typmods...

	Thanks!

		Stephen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20080626/21fc2e50/attachment.sig>


More information about the postgis-devel mailing list