File: droptopogeometrycolumn.sql

package info (click to toggle)
postgis 3.3.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 87,748 kB
  • sloc: ansic: 158,671; sql: 91,546; xml: 54,004; cpp: 12,339; sh: 5,187; perl: 5,100; makefile: 3,085; python: 1,205; yacc: 447; lex: 151; javascript: 6
file content (24 lines) | stat: -rw-r--r-- 1,192 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
set client_min_messages to ERROR;

-- Drop corrupted topology (with missing layer tables)
-- See http://trac.osgeo.org/postgis/ticket/3016
SELECT NULL FROM topology.CreateTopology('t3016');
CREATE TABLE t3016f (id int);
SELECT NULL FROM topology.AddTopoGeometryColumn('t3016', 'public', 't3016f', 'g', 'LINE');
DROP TABLE t3016.relation;
SELECT 't3016.drop', topology.DropTopoGeometryColumn('public','t3016f','g');
SELECT 't3016', 'UNEXPECTED LAYER', * FROM topology.layer WHERE table_name = 't5118f';
DROP TABLE t3016f;
SELECT NULL FROM topology.DropTopology('t3016');

-- Drop corrupted topology (with missing layer sequence)
-- See http://trac.osgeo.org/postgis/ticket/5118
SELECT NULL FROM topology.CreateTopology('t5118');
CREATE TABLE t5118f (id int);
SELECT NULL FROM topology.AddTopoGeometryColumn('t5118', 'public', 't5118f', 'g', 'LINE');
INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1);
DROP SEQUENCE t5118.topogeo_s_1;
SELECT 't5118.drop', topology.DropTopoGeometryColumn('public','t5118f','g');
SELECT 't5118', 'UNEXPECTED LAYER', * FROM topology.layer WHERE table_name = 't5118f';
DROP TABLE t5118f;
SELECT NULL FROM topology.DropTopology('t5118');