From: Sandro Santilli Date: Wed, 2 Jun 2004 17:15:20 +0000 (+0000) Subject: stale locks removal in fix_geometry_columns() and update_geometry_stats(). Fixed... X-Git-Tag: pgis_0_9_1~230 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c3e725824616e4a92b71d08a968fea1e6a419bd;p=postgis stale locks removal in fix_geometry_columns() and update_geometry_stats(). Fixed a bug in fix_geometry_columns() deleting stats. git-svn-id: http://svn.osgeo.org/postgis/trunk@564 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis.sql.in b/postgis.sql.in index df777a030..65f1103e3 100644 --- a/postgis.sql.in +++ b/postgis.sql.in @@ -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( , , ) +----------------------------------------------------------------------- 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; '