From: Sandro Santilli Date: Fri, 4 Jun 2004 12:40:43 +0000 (+0000) Subject: Added comments about fix_geometry_columns() job. X-Git-Tag: pgis_0_9_1~204 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89814f03111c17b109a8ad9470f2b5ba1ccf28eb;p=postgis Added comments about fix_geometry_columns() job. 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 --- diff --git a/postgis.sql.in b/postgis.sql.in index dba59ce1f..3740dde0d 100644 --- a/postgis.sql.in +++ b/postgis.sql.in @@ -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