]> granicus.if.org Git - postgis/commitdiff
stale locks removal in fix_geometry_columns() and update_geometry_stats(). Fixed...
authorSandro Santilli <strk@keybit.net>
Wed, 2 Jun 2004 17:15:20 +0000 (17:15 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 2 Jun 2004 17:15:20 +0000 (17:15 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@564 b70326c6-7e19-0410-871a-916f4a2858ee

postgis.sql.in

index df777a030d952dee804da1be731ca0dd1e2d8ad6..65f1103e3d758a2b80bc8b91e1cf0292352a0fd2 100644 (file)
@@ -733,8 +733,9 @@ CREATE FUNCTION get_proj4_from_srid(integer) RETURNS text AS
 LANGUAGE 'sql' WITH (iscachable,isstrict);
 
 
--- - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-----------------------------------------------------------------------
 -- FIX_GEOMETRY_COLUMNS() 
+-----------------------------------------------------------------------
 --
 
 CREATE FUNCTION fix_geometry_columns() RETURNS text
@@ -759,8 +760,7 @@ BEGIN
 
        UPDATE geometry_columns SET
                attrelid = NULL,
-               varattnum = NULL,
-               stats = NULL;
+               varattnum = NULL;
 
        UPDATE geometry_columns SET attrelid = (
                SELECT c.oid 
@@ -779,6 +779,9 @@ BEGIN
                AND a.attname = geometry_columns.f_geometry_column::name
                AND a.attrelid = c.oid AND c.relnamespace = n.oid
                );
+
+       -- remove stale records
+       DELETE FROM geometry_columns WHERE attrelid IS NULL;
 #endif
 
        RETURN ''geometry_columns table is now linked to the system tables'';
@@ -789,6 +792,7 @@ LANGUAGE 'plpgsql' ;
 
 -----------------------------------------------------------------------
 -- FIND_EXTENT( <schema name>, <table name>, <column name> )
+-----------------------------------------------------------------------
 
 CREATE FUNCTION find_extent(text,text,text) RETURNS box3d AS
 '
@@ -3028,6 +3032,9 @@ BEGIN
                AND a.attrelid = c.oid;
 #endif
 
+       -- remove stale records
+       DELETE FROM geometry_columns WHERE attrelid IS NULL;
+
        return ''done'';
 END;
 '