qwat / qwat-data-model

TEKSI Water module (project QWAT) - PostgreSQL / postgis Datamodel
https://www.teksi.ch
23 stars 24 forks source link

Error using pum during restore with psql on postgres 9.4.5, postgis 2.2.0 #214

Closed ponceta closed 6 years ago

ponceta commented 6 years ago

Trying to update with pum

Everythings going fine except my srs duplicated key error on 9.4.5, postgis 2.2.0

Parameters:
    CLEAN       = 0
    LOCALDIR    = /home/regis/OSLANDIA/projets_locaux/QWAT/local_update_dir_test/
    TMPFILEDUMP = /tmp/qwat_dump
    UPGRADE     = 0

    PUM_VERSION = pum version 0.5.6

    Current QWAT model version = 1.3.1

Initializing qwat comparison db

PUM version: pum version 0.5.6

CREATE EXTENSION
CREATE EXTENSION
ERREUR:  le schéma « qwat_sys » existe déjà

PUM baseline on qwat_comp

Set baseline...OK

Test and upgrade qwat core

Test and upgrade...Dump...OK
Restore...ERROR
b'pg_restore: [archiver (db)] Error while PROCESSING TOC:\npg_restore: [archiver (db)] Error from TOC entry 3971; 0 268291 TABLE DATA spatial_ref_sys postgres\npg_restore: [archiver (db)] COPY failed for table "spatial_ref_sys": ERREUR:  la valeur d\'une cl\xc3\xa9 dupliqu\xc3\xa9e rompt la contrainte unique \xc2\xab spatial_ref_sys_pkey \xc2\xbb\nDETAIL:  La cl\xc3\xa9 \xc2\xab (srid)=(5013) \xc2\xbb existe d\xc3\xa9j\xc3\xa0.\nCONTEXT:  COPY spatial_ref_sys, ligne 1\nWARNING: errors ignored on restore: 1\n'

On the old tool, I could ignore this error, should pum be able to ignore some errors due to postgis versions or should we find a way to fix this? Any postgis masters around?

sylvainbeo commented 6 years ago

Ok, i've added a delta file. Please see :

https://github.com/qwat/qwat-data-model/pull/227

And validate the PR.

sylvainbeo commented 6 years ago

Solve by adding some more cleaning in the deltas. I'm closing.