]> granicus.if.org Git - postgis/commitdiff
Added comments about fix_geometry_columns() job.
authorSandro Santilli <strk@keybit.net>
Fri, 4 Jun 2004 12:40:43 +0000 (12:40 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 4 Jun 2004 12:40:43 +0000 (12:40 +0000)
SRID and type checks made stricter in fix_geometry_columns().

git-svn-id: http://svn.osgeo.org/postgis/trunk@590 b70326c6-7e19-0410-871a-916f4a2858ee

postgis.sql.in

index dba59ce1fdca6c341d2e808bec9fc0f8d0a4cd54..3740dde0d25bd8705733bfbd2833cf11edb5402c 100644 (file)
@@ -350,6 +350,19 @@ LANGUAGE 'sql' WITH (iscachable,isstrict);
 -----------------------------------------------------------------------
 -- FIX_GEOMETRY_COLUMNS() 
 -----------------------------------------------------------------------
+-- This function will:
+--
+--     o try to fix the schema of records with an invalid one
+--             (for PG>=73)
+--
+--     o link records to system tables through attrelid and varattnum
+--             (for PG<75)
+--
+--     o delete all records for which no linking was possible
+--             (for PG<75)
+--     
+-- 
+-----------------------------------------------------------------------
 CREATEFUNCTION fix_geometry_columns() RETURNS text
 AS 
 '
@@ -388,8 +401,8 @@ BEGIN
                 AND sridcheck.conname = ''$1''
                 AND typecheck.conrelid = c.oid
                 AND typecheck.conname = ''$2''
-                AND sridcheck.consrc ~ srid::text
-                AND typecheck.consrc ~ type::text
+                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