#190: populate_geometry_columns gives nonstandard use of \' in a string literal in 8.4

git-svn-id: http://svn.osgeo.org/postgis/trunk@4152 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Regina Obe 2009-06-08 17:35:06 +00:00
parent 775052a442
commit dcf75b7daf

View file

@ -2447,6 +2447,7 @@ LANGUAGE 'plpgsql' _VOLATILE;
----------------------------------------------------------------------- -----------------------------------------------------------------------
CREATEFUNCTION populate_geometry_columns(tbl_oid oid) CREATEFUNCTION populate_geometry_columns(tbl_oid oid)
RETURNS integer AS RETURNS integer AS
RETURNS integer AS
$$ $$
DECLARE DECLARE
gcs RECORD; gcs RECORD;
@ -2515,7 +2516,7 @@ BEGIN
CHECK (srid(' || quote_ident(gcs.attname) || ') = ' || gsrid || ')'; CHECK (srid(' || quote_ident(gcs.attname) || ') = ' || gsrid || ')';
EXCEPTION EXCEPTION
WHEN check_violation THEN WHEN check_violation THEN
RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could not apply constraint CHECK (srid(%) = %)', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), quote_ident(gcs.attname), gsrid; RAISE WARNING 'Not inserting ''%'' in ''%.%'' into geometry_columns: could not apply constraint CHECK (srid(%) = %)', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), quote_ident(gcs.attname), gsrid;
gc_is_valid := false; gc_is_valid := false;
END; END;
END IF; END IF;
@ -2549,7 +2550,7 @@ BEGIN
CHECK (ndims(' || quote_ident(gcs.attname) || ') = '||gndims||')'; CHECK (ndims(' || quote_ident(gcs.attname) || ') = '||gndims||')';
EXCEPTION EXCEPTION
WHEN check_violation THEN WHEN check_violation THEN
RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could not apply constraint CHECK (ndims(%) = %)', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), quote_ident(gcs.attname), gndims; RAISE WARNING 'Not inserting ''%'' in ''%.%'' into geometry_columns: could not apply constraint CHECK (ndims(%) = %)', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), quote_ident(gcs.attname), gndims;
gc_is_valid := false; gc_is_valid := false;
END; END;
END IF; END IF;
@ -2593,11 +2594,11 @@ BEGIN
END IF; END IF;
IF (gsrid IS NULL) THEN IF (gsrid IS NULL) THEN
RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could not determine the srid', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname); RAISE WARNING 'Not inserting ''%'' in ''%.%'' into geometry_columns: could not determine the srid', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname);
ELSIF (gndims IS NULL) THEN ELSIF (gndims IS NULL) THEN
RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could not determine the number of dimensions', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname); RAISE WARNING 'Not inserting ''%'' in ''%.%'' into geometry_columns: could not determine the number of dimensions', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname);
ELSIF (gtype IS NULL) THEN ELSIF (gtype IS NULL) THEN
RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could not determine the geometry type', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname); RAISE WARNING 'Not inserting ''%'' in ''%.%'' into geometry_columns: could not determine the geometry type', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname);
ELSE ELSE
-- Only insert into geometry_columns if table constraints could be applied. -- Only insert into geometry_columns if table constraints could be applied.
IF (gc_is_valid) THEN IF (gc_is_valid) THEN
@ -2645,11 +2646,11 @@ BEGIN
gtype := gc.geometrytype; gtype := gc.geometrytype;
IF (gndims IS NULL) THEN IF (gndims IS NULL) THEN
RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could not determine ndims', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname); RAISE WARNING 'Not inserting ''%'' in ''%.%'' into geometry_columns: could not determine ndims', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname);
ELSIF (gsrid IS NULL) THEN ELSIF (gsrid IS NULL) THEN
RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could not determine srid', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname); RAISE WARNING 'Not inserting ''%'' in ''%.%'' into geometry_columns: could not determine srid', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname);
ELSIF (gtype IS NULL) THEN ELSIF (gtype IS NULL) THEN
RAISE WARNING 'Not inserting \'%\' in \'%.%\' into geometry_columns: could not determine gtype', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname); RAISE WARNING 'Not inserting ''%'' in ''%.%'' into geometry_columns: could not determine gtype', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname);
ELSE ELSE
query := 'INSERT INTO geometry_columns (f_table_catalog,f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, type) ' || query := 'INSERT INTO geometry_columns (f_table_catalog,f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, type) ' ||
'VALUES ('''', ' || quote_literal(gcs.nspname) || ',' || quote_literal(gcs.relname) || ',' || quote_literal(gcs.attname) || ',' || gndims || ',' || gsrid || ',' || quote_literal(gtype) || ')'; 'VALUES ('''', ' || quote_literal(gcs.nspname) || ',' || quote_literal(gcs.relname) || ',' || quote_literal(gcs.attname) || ',' || gndims || ',' || gsrid || ',' || quote_literal(gtype) || ')';