mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-26 01:52:37 +00:00
probe_geometry_columns() return message extended
git-svn-id: http://svn.osgeo.org/postgis/trunk@591 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
89814f0311
commit
044a49c615
|
@ -476,7 +476,31 @@ CREATEFUNCTION probe_geometry_columns() RETURNS text AS
|
|||
'
|
||||
DECLARE
|
||||
inserted integer;
|
||||
oldcount integer;
|
||||
probed integer;
|
||||
BEGIN
|
||||
|
||||
SELECT count(*) INTO oldcount FROM geometry_columns;
|
||||
|
||||
SELECT count(*) INTO probed
|
||||
FROM pg_class c, pg_attribute a, pg_type t,
|
||||
#if USE_VERSION >= 73
|
||||
pg_namespace n,
|
||||
#endif
|
||||
pg_constraint sridcheck, pg_constraint typecheck
|
||||
WHERE t.typname = ''geometry''
|
||||
AND a.atttypid = t.oid
|
||||
AND a.attrelid = c.oid
|
||||
#if USE_VERSION >= 73
|
||||
AND c.relnamespace = n.oid
|
||||
AND sridcheck.connamespace = n.oid
|
||||
AND typecheck.connamespace = n.oid
|
||||
#endif
|
||||
AND sridcheck.conrelid = c.oid
|
||||
AND sridcheck.conname = ''$1''
|
||||
AND typecheck.conrelid = c.oid
|
||||
AND typecheck.conname = ''$2'';
|
||||
|
||||
INSERT INTO geometry_columns SELECT
|
||||
''''::varchar as f_table_catalogue,
|
||||
#if USE_VERSION >= 73
|
||||
|
@ -528,7 +552,10 @@ BEGIN
|
|||
|
||||
GET DIAGNOSTICS inserted = ROW_COUNT;
|
||||
|
||||
RETURN ''new records: ''||inserted;
|
||||
RETURN ''probed:''||probed||
|
||||
'' inserted:''||inserted||
|
||||
'' conflicts:''||probed-inserted||
|
||||
'' stale:''||oldcount-probed;
|
||||
END
|
||||
|
||||
' LANGUAGE 'plpgsql';
|
||||
|
|
Loading…
Reference in a new issue