Did you test to backup / restore this kind of fields ?
Ok, now, the geometry fields are correctly written like :
Code: Select all
CREATE TABLE public."DMChantier"
(
"ChantierID" bigint,
"Nom" varchar(5) NOT NULL,
"Type" smallint NOT NULL,
"Finalite" smallint NOT NULL,
"Etat" smallint NOT NULL,
"Emprise" geometry NOT NULL,
"BoundingBox" geometry NOT NULL,
"DateValidite" date,
"DateDebut" date,
"DateFin" date,
"NbDC" smallint NOT NULL,
"Commentaires" varchar(1024),
"CheminRacine" varchar(260) NOT NULL,
"FKPackageChantierID" bigint
);
But, this Table backup generate a line like :
Code: Select all
INSERT INTO public."DMChantier" VALUES (1, E'NALT4', 0, 4, 1, E'\\001\\003\\000\\000 \\346\\020\\000\\000\\001\\000\\000\\000\\037\\000\\000\\000\\000\\000\\000\\000\\000\\000$@\\000\\000\\000\\000\\000\\0006@\\000\\000\\000\\000\\000\\000$@\\000\\000\\000\\000\\000\\0007@\\000\\000\\000\\000\\000\\000&@\\000\\000\\000\\000\\000\\0007@\\000\\000\\000\\000\\000\\000&@\\000\\000\\000\\000\\000\\0008@\\000\\000\\000\\000\\000\\000(@\\000\\000\\000\\000\\000\\0008@\\000\\000\\000\\000\\000\\000*@\\000\\000\\000\\000\\000\\0008@\\000\\000\\000\\000\\000\\000,@\\000\\000\\000\\000\\000\\0008@\\000\\000\\000\\000\\000\\000.@\\000\\000\\000\\000\\000\\0008@\\000\\000\\000\\000\\000\\0000@\\000\\000\\000\\000\\000\\0008@\\000\\000\\000\\000\\000\\0001@\\000\\000\\000\\000\\000\\0008@\\000\\000\\000\\000\\000\\0001@\\000\\000\\000\\000\\000\\0007@\\000\\000\\000\\000\\000\\0002@\\000\\000\\000\\000\\000\\0007@\\000\\000\\000\\000\\000\\0003@\\000\\000\\000\\000\\000\\0007@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0007@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0006@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0005@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0003@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0002@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0001@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0000@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\000.@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\000.@\\000\\000\\000\\000\\000\\0005@\\000\\000\\000\\000\\000\\000,@\\000\\000\\000\\000\\000\\0005@\\000\\000\\000\\000\\000\\000,@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\000*@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\000(@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\000(@\\000\\000\\000\\000\\000\\0005@\\000\\000\\000\\000\\000\\000&@\\000\\000\\000\\000\\000\\0005@\\000\\000\\000\\000\\000\\000&@\\000\\000\\000\\000\\000\\0006@\\000\\000\\000\\000\\000\\000$@\\000\\000\\000\\000\\000\\0006@', E'\\001\\003\\000\\000\\000\\001\\000\\000\\000\\005\\000\\000\\000\\000\\000\\000\\000\\000\\000$@\\000\\000\\000\\000\\000\\0008@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0008@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\000$@\\000\\000\\000\\000\\000\\0004@\\000\\000\\000\\000\\000\\000$@\\000\\000\\000\\000\\000\\0008@', '2010-01-01 AD', '2015-01-01 AD', '2018-12-31 AD', 32, E'', E'Z:\\NALT4', NULL);
Try to execute this request with PgSqlDump or with pgAdmin : it will not work :
For pgAdmin :
ERREUR: parse error - invalid geometry
LINE 1: ...public."DMChantier" VALUES (1, E'NALT4', 0, 4, 1, E'\\001\\0...
^
HINT: "\0" <-- parse error at position 2 within geometry
********** Erreur **********
ERREUR: parse error - invalid geometry
État SQL :XX000
Astuce : "\0" <-- parse error at position 2 within geometry
Caractère : 63
For PgSqlDump, an exception is raised :
Filename : lwgeom_pg.c
"\"\\0\" <-- parse error at position 2 within geometry"
"pg_parser_errhint"
error = parse error - invalid geometry
.
It seems that the backup work well for table CREATION, not for the data of the table.
A way to make it work well ?
In
postgresql documentation
The geometry are not saved / backup into blob