qwat / qwat-data-model

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

Error importing data sample #224

Closed lbartoletti closed 6 years ago

lbartoletti commented 6 years ago

Data and structure

1.3.1

backup

> pg_restore -U postgres --dbname qwat -e --no-owner --verbose --jobs=3 --disable-triggers --port 5432 qwat_v1.3.X_data_and_structure_sample.backup doesn't works:

pg_restore: connexion à la base de données pour la restauration
pg_restore: a impliqué une restauration des données uniquement
pg_restore: traitement de l'élément 4970 ENCODING ENCODING
pg_restore: traitement de l'élément 4971 STDSTRINGS STDSTRINGS
pg_restore: entrée dans la boucle parallèle principale
pg_restore: élément de lancement 4863 TABLE DATA annotationline
pg_restore: élément de lancement 5124 SEQUENCE SET annotationline_id_seq
pg_restore: élément de lancement 4865 TABLE DATA annotationpoint
pg_restore: pg_restore: désactivation des déclencheurs pour annotationline
exécution de SEQUENCE SET annotationline_id_seq
pg_restore: désactivation des déclencheurs pour annotationpoint
pg_restore: [programme d'archivage (db)] Erreur pendant le traitement de la TOC (« PROCESSING TOC ») :
pg_restore: [programme d'archivage (db)] Erreur à partir de l'entrée TOC 4863 ; 0 18131 TABLE DATA annotationline postgres
pg_restore: [programme d'archivage (db)] could not execute query: ERROR:  relation "annotationline" does not exist
    La commande était : ALTER TABLE annotationline DISABLE TRIGGER ALL;

pg_restore: [programme d'archivage (db)] Erreur pendant le traitement de la TOC (« PROCESSING TOC ») :
pg_restore: [programme d'archivage (db)] Erreur à partir de l'entrée TOC 4865 ; 0 18142 TABLE DATA annotationpoint postgres
pg_restore: [programme d'archivage (db)] could not execute query: ERROR:  relation "annotationpoint" does not exist
    La commande était : ALTER TABLE annotationpoint DISABLE TRIGGER ALL;

pg_restore: [programme d'archivage (db)] Erreur pendant le traitement de la TOC (« PROCESSING TOC ») :
pg_restore: [programme d'archivage (db)] Erreur à partir de l'entrée TOC 5124 ; 0 0 SEQUENCE SET annotationline_id_seq postgres
pg_restore: [programme d'archivage (db)] could not execute query: ERROR:  relation "annotationline_id_seq" does not exist
LIGNE 1 : SELECT pg_catalog.setval('annotationline_id_seq', 2878, true...
                                   ^
    La commande était : SELECT pg_catalog.setval('annotationline_id_seq', 2878, true);

plain sql

> psql -U postgres -d qwat -v ON_ERROR_STOP=1 < qwat_v1.3.1_data_and_structure_sample.sql

[SET...]
ERROR:  relation "annotationline" does not exist

1.2.9 (qwat-data-sample)

backup

> pg_restore qwat_v1.2.X_data_and_structure_sample.backup works

plain sql

> psql -U postgres -d qwat -v ON_ERROR_STOP=1 < qwat_v1.2.9_data_and_structure_sample.sql works

Data only

1.3.1 and 1.2.9 plain sql

psql -U postgres -d qwat -v ON_ERROR_STOP=1 < qwat_v1.X.X_data_only_sample.sql

missing SET session_replication_role = replica; in header to disable temporarily all triggers Without it, we got this error:

ERROR:  function st_startpoint(public.geometry) does not exist
LIGNE 1 : SELECT ST_Distance( ST_StartPoint(NEW.geometry), ST_EndPoint...
                              ^
ASTUCE : No function matches the given name and argument types. You might need to add explicit type casts.
REQUÊTE : SELECT ST_Distance( ST_StartPoint(NEW.geometry), ST_EndPoint(NEW.geometry) )
CONTEXTE : PL/pgSQL function ft_dimension_distance_distance() line 3 at assignment
COPY dimension_distance, line 1: "51    4.80    4.80079287397523569     \N      0102000020155500000200000086072F58C46D1F41788D05B6AD6003414EB72741C76..."

1.3.1 backup

pg_restore -U postgres --dbname qwat -e --no-owner --verbose --jobs=3 --disable-triggers --port 5432 qwat_v1.3.1_data_only_sample.backup works

elemoine commented 6 years ago

@lbartoletti have you seen https://github.com/qwat/qwat-data-model/pull/220? This PR fixes a bug where data+structure dumps were not correctly created. This PR is merged but I am not sure @haubourg has updated the dumps on the 1.3.1 dumps on the Releases page.

lbartoletti commented 6 years ago

@elemoine Yes, it's works. Thanks.

I'll update the doc.

elemoine commented 6 years ago

I've uploaded new data+structure dumps on the 1.3.1 release page.