LANGUAGE 'sql' WITH (iscachable,isstrict);
--- - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-----------------------------------------------------------------------
-- FIX_GEOMETRY_COLUMNS()
+-----------------------------------------------------------------------
--
CREATE FUNCTION fix_geometry_columns() RETURNS text
UPDATE geometry_columns SET
attrelid = NULL,
- varattnum = NULL,
- stats = NULL;
+ varattnum = NULL;
UPDATE geometry_columns SET attrelid = (
SELECT c.oid
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'';
-----------------------------------------------------------------------
-- FIND_EXTENT( <schema name>, <table name>, <column name> )
+-----------------------------------------------------------------------
CREATE FUNCTION find_extent(text,text,text) RETURNS box3d AS
'
AND a.attrelid = c.oid;
#endif
+ -- remove stale records
+ DELETE FROM geometry_columns WHERE attrelid IS NULL;
+
return ''done'';
END;
'