From: Sandro Santilli Date: Tue, 8 Feb 2005 07:37:42 +0000 (+0000) Subject: Fixed probe_geometry_columns so to work on spatial tables with multiple X-Git-Tag: pgis_1_0_0RC3~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=760c4df11585b37e5973b1bcaa4954c7f81c111b;p=postgis Fixed probe_geometry_columns so to work on spatial tables with multiple geometry columns. git-svn-id: http://svn.osgeo.org/postgis/trunk@1378 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/lwpostgis.sql.in b/lwgeom/lwpostgis.sql.in index b66b4a3ad..21e01efd4 100644 --- a/lwgeom/lwpostgis.sql.in +++ b/lwgeom/lwpostgis.sql.in @@ -2067,15 +2067,16 @@ BEGIN AND c.oid = a.attrelid AND c.relnamespace = n.oid AND f_geometry_column::name = a.attname + AND sridcheck.conrelid = c.oid - --AND sridcheck.conname = ''$1'' AND sridcheck.consrc LIKE ''(srid(% = %)'' + AND sridcheck.consrc ~ textcat('' = '', srid::text) + AND typecheck.conrelid = c.oid - --AND typecheck.conname = ''$2'' AND typecheck.consrc LIKE ''((geometrytype(%) = ''''%''''::text) OR (% IS NULL))'' - AND sridcheck.consrc ~ textcat('' = '', srid::text) AND typecheck.consrc ~ textcat('' = '''''', type::text) + AND NOT EXISTS ( SELECT oid FROM geometry_columns gc WHERE c.relname::varchar = gc.f_table_name @@ -2177,12 +2178,10 @@ BEGIN AND typecheck.connamespace = n.oid #endif AND sridcheck.conrelid = c.oid - --AND sridcheck.conname = ''$1'' - AND sridcheck.consrc LIKE ''(srid(% = %)'' + AND sridcheck.consrc LIKE ''(srid(''||a.attname||'') = %)'' AND typecheck.conrelid = c.oid - --AND typecheck.conname = ''$2''; AND typecheck.consrc LIKE - ''((geometrytype(%) = ''''%''''::text) OR (% IS NULL))'' + ''((geometrytype(''||a.attname||'') = ''''%''''::text) OR (% IS NULL))'' ; INSERT INTO geometry_columns SELECT @@ -2221,12 +2220,10 @@ BEGIN AND typecheck.connamespace = n.oid #endif AND sridcheck.conrelid = c.oid - --AND sridcheck.conname = ''$1'' - AND sridcheck.consrc LIKE ''(srid(% = %)'' + AND sridcheck.consrc LIKE ''(srid(''||a.attname||'') = %)'' AND typecheck.conrelid = c.oid - --AND typecheck.conname = ''$2'' AND typecheck.consrc LIKE - ''((geometrytype(%) = ''''%''''::text) OR (% IS NULL))'' + ''((geometrytype(''||a.attname||'') = ''''%''''::text) OR (% IS NULL))'' AND NOT EXISTS ( SELECT oid FROM geometry_columns gc