Do not raise an exception from DropGeometryTable if a non-existing table is given. Patch by Andrea Peri. Regress test mine. Closes ticket #861.

git-svn-id: http://svn.osgeo.org/postgis/trunk@7014 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2011-04-11 09:53:55 +00:00
parent 87df11bcd3
commit f14cf72b71
3 changed files with 6 additions and 2 deletions

View file

@ -2578,9 +2578,9 @@ BEGIN
' f_table_name = ' || quote_literal(table_name);
-- Remove table
EXECUTE 'DROP TABLE '
EXECUTE 'DROP TABLE IF EXISTS '
|| quote_ident(real_schema) || '.' ||
quote_ident(table_name);
quote_ident(table_name) || ' RESTRICT';
RETURN
real_schema || '.' ||

View file

@ -6,3 +6,4 @@ CREATE TABLE test_pt(gid SERIAL PRIMARY KEY, geom geometry);
INSERT INTO test_pt(geom) VALUES(ST_GeomFromEWKT('SRID=4326;POINT M(1 2 3)'));
SELECT populate_geometry_columns('test_pt'::regclass);
SELECT 'The result: ' || DropGeometryTable('test_pt');
SELECT 'Unexistant: ' || DropGeometryTable('unexistent'); -- see ticket #861

View file

@ -2,3 +2,6 @@ NOTICE: CREATE TABLE will create implicit sequence "test_pt_gid_seq" for serial
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_pt_pkey" for table "test_pt"
1
The result: public.test_pt dropped.
NOTICE: table "unexistent" does not exist, skipping
PL/pgSQL function "dropgeometrytable" line 22 at EXECUTE statement
Unexistant: public.unexistent dropped.