Opened 4 months ago

Closed 4 months ago

#5590 closed defect (fixed)

loading topology.sql: ERROR: schema "topology" already exists

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.4.1
Component: topology Version: 3.4.x
Keywords: Cc:

Description

In master branch, topology.sql doesn't load:

[strk@c19:/usr/local/src/postgis/postgis/build/pg13(main)] psql -f topology/topology.sql tt --set ON_ERROR_STOP=1
CREATE SCHEMA
COMMENT
BEGIN
CREATE TABLE
CREATE FUNCTION
CREATE TABLE
CREATE TRIGGER
CREATE TYPE
CREATE DOMAIN
ALTER DOMAIN
psql:topology/topology.sql:388: NOTICE:  constraint "type_range" of domain "topology.topoelement" does not exist, skipping
ALTER DOMAIN
ALTER DOMAIN
CREATE DOMAIN
ALTER DOMAIN
ALTER DOMAIN
CREATE FUNCTION
...
CREATE CAST
CREATE FUNCTION
psql:topology/topology.sql:1312: ERROR:  type "topogeometry" does not exist
[strk@c19:/usr/local/src/postgis/postgis/build/pg13(main)] grep  -n . topology/topology.sql  | grep ^1312
1312:CREATE CAST (topogeometry AS int[]) WITH FUNCTION TopoElement(topogeometry) AS ASSIGNMENT;

It sounds like a lack of qualification for the type.

Thing work ok in stable-3.3 but fail in stable-3.4 and master branches

Change History (4)

comment:1 by strk, 4 months ago

The offending commit is [cf2b98cd00/git] which entered the cast without qualification.

This is hard to spot because the very first time topology is loaded, the search_path of the target database is changed to include "topology" schema, so next time you source the file you succeed due to that, or so it looks.

comment:2 by strk, 4 months ago

#5336 is the ticket due to which the new cast was added and confirms it's 3.4.0 only

comment:3 by Sandro Santilli <strk@…>, 4 months ago

In 023b139/git:

Fix script-based load of topology by qualifying refs to TopoGeometry

References #5590 in master branch (3.5.0dev)

comment:4 by Sandro Santilli <strk@…>, 4 months ago

Resolution: fixed
Status: newclosed

In e8edb36/git:

Fix script-based load of topology by qualifying refs to TopoGeometry

Closes #5590 in 3.4 branch (3.4.1dev)

Note: See TracTickets for help on using tickets.