[postgis-devel] postgis_restore.pl problem

Daniele Debernardi daniele at geosar.ch
Thu Jan 24 23:35:07 PST 2013


On 24. 01. 13 17:07, Sandro Santilli wrote:
> On Thu, Jan 24, 2013 at 04:51:50PM +0100, Sandro Santilli wrote:
>> On Thu, Jan 24, 2013 at 04:25:36PM +0100, Daniele Debernardi wrote:
>>> Hi,
>>> using the postgis_restore.pl in postgis 2.0.2, I found a problem
>>> when he rewrite the spatial table constraints (around line ~230),
>>> he skips geometry columns that has upper case letters and than they
>>> have double "" around it.
>>>
>>> changing the line:
>>> if ( $subline =~ /CONSTRAINT enforce_srid_/i ) {
>>>
>>> to:
>>> if ( $subline =~ /CONSTRAINT enforce_srid_/i || $subline =~
>>> /CONSTRAINT "enforce_srid_/i) {
>>>
>>> solves the problem considering them too
>> Could you try this line please:
>>
>>   if ( $subline =~ /CONSTRAINT "?enforce_srid_/i ) {
> Also, if you look at the .pl file you can see 2 examples, taken from
> real world cases of dumps. Could you provide the snippet resulting
> from your dump too, for documentation purpose ?
>
> Thank you !
>
> --strk;
>
>   http://www.cartodb.com - Map, analyze and build applications with your data
>
>                                         ~~ http://strk.keybit.net
>
Hi,
I have not yet tried with the ? character before enforce_srid...
the table I had problem was:

CREATE TABLE "PIANIFICAZIONE__ELEMENTO_LINEA" (
     soft_gis_serial integer NOT NULL,
     "ELEMENTO" text,
     "CODICE_ELEMENTO" integer,
     "TESTO_ELEMENTO" text,
     "COD_PIANO" text,
     "DATA_approvazione" date,
     "RisCdS" text,
     "Geometrie" public.geometry,
     CONSTRAINT "enforce_dims_Geometrie" CHECK 
((public.st_ndims("Geometrie") = 2)),
     CONSTRAINT "enforce_geotype_Geometrie" CHECK 
(((public.geometrytype("Geometrie") = 'MULTICURVE'::text) OR 
("Geometrie" IS NULL))),
     CONSTRAINT "enforce_srid_Geometrie" CHECK 
((public.st_srid("Geometrie") = (-1)))
);

Today I will probably try your solution.

best regards,
Daniele





More information about the postgis-devel mailing list