afimb / gtfslib-python

An open source library in python for reading GTFS files and computing various stats and indicators about Public Transport networks
GNU General Public License v3.0
44 stars 6 forks source link

Foreign key constrain violation on deleting data with shapes on PostgreSQL #56

Closed laurentg closed 7 years ago

laurentg commented 7 years ago
$ gtfsdbloader postgresql://gtfs@localhost/gtfs --delete
...
sqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) update or delete on table "shapes" violates foreign key constraint "trips_feed_id_fkey2" on table "trips"
DETAIL:  Key (feed_id, shape_id)=(, 24) is still referenced from table "trips".
 [SQL: 'DELETE FROM shapes WHERE shapes.feed_id = %(feed_id_1)s'] [parameters: {'feed_id_1': ''}]