[postgis-devel] [PostGIS] #1426: OGR2OGR fails importing data to postgis
PostGIS
trac at osgeo.org
Mon Jan 2 08:51:29 PST 2012
#1426: OGR2OGR fails importing data to postgis
-----------------------------+----------------------------------------------
Reporter: anguscarr | Owner: pramsey
Type: defect | Status: new
Priority: low | Milestone: PostGIS 2.0.0
Component: postgis | Version: 1.5.X
Keywords: ogr2ogr, import |
-----------------------------+----------------------------------------------
When I run ogr2ogr, I get:
{{{
C:\Temp>"c:\program files\gdal\ogr2ogr" -f "PostgreSQL" PG:"host=127.0.0.1
user=apc dbname=FMP port=5433"
-nln black_spruce_2011.aoc01 c:\temp\tmpsqqk3e PAL
ERROR 1: AddGeometryColumn failed for layer black_spruce_2011.aoc01,
layer creation has failed.
ERROR 1: Terminating translation prematurely after failed
translation of layer PAL (use -skipfailures to skip errors)
}}}
I had a look into the DB logs, and got this:
{{{
ERROR: cannot delete from view "geometry_columns"
HINT: You need an unconditional ON DELETE DO INSTEAD rule or an INSTEAD
OF DELETE trigger.
STATEMENT: DELETE FROM geometry_columns WHERE f_table_name =
'aoc01' AND f_table_schema = 'black_spruce_2011'
ERROR: current transaction is aborted, commands ignored until end of
transaction block
}}}
For the short term, I added this rule:
{{{
CREATE OR REPLACE RULE ogr2ogr_delete_problem AS
ON DELETE TO public.geometry_columns
DO INSTEAD NOTHING ;
}}}
Obviously, that's not a long-term solution, but I don't think I should fix
it without looking to the larger community. I assume this is an OGR2OGR
bug, but since my fix of the day is on my DB, I thought I would post here.
Is it safe to leave this rule in place for the long term?
Right now, I am loading data into an empty db, and it's ok for now.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1426>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list