Opened 12 years ago
Closed 12 years ago
#1865 closed defect (fixed)
Data loss in postgis_restore.pl when data rows have leading dashes
Reported by: | darkpanda | Owned by: | strk |
---|---|---|---|
Priority: | high | Milestone: | PostGIS 1.5.5 |
Component: | postgis | Version: | 1.5.X |
Keywords: | Cc: |
Description
postgis_restore.pl can skip over valid data in COPY statements if a row line begins with leading dashes, i.e. appears to be an SQL comment.
Attached is a patch that checks for COPY commands and for the accompanying "\." line that completes them and avoids stripping comments for the duration.
Attachments (2)
Change History (9)
by , 12 years ago
Attachment: | 0001-Don-t-strip-comment-lines-in-the-middle-of-COPY-comm.patch added |
---|
comment:1 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
I think the same issue exists in older versions of PostGIS as well, so if there were any plans for further 1.5 releases the same style of fix should probably be applied there as well. I haven't had to use postgis_restore.pl on my older 1.5 databases, but I'm assuming the same issue will occur around line 648. I haven't personally confirmed this however, but that's what it looks like in the code.
I can write a quick patch if y'all want, but I believe the few lines that the patch consists of are going to be pretty much identical to the existing patch.
comment:3 by , 12 years ago
Milestone: | PostGIS 2.0.1 → PostGIS 1.5.4 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Version: | 2.0.x → 1.5.X |
I'll happily commit a patch (or pull it from a git branch)
by , 12 years ago
Attachment: | 0001-Don-t-strip-comment-lines-in-the-middle-of-COPY-comm-svn-1-5.patch added |
---|
comment:4 by , 12 years ago
Alright, I gave it a shot. See the latest attached patch against the 1.5 branch.
comment:5 by , 12 years ago
Milestone: | PostGIS 1.5.4 → PostGIS 1.5.5 |
---|
comment:6 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:7 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
r10049 in 1.5 branch — all done
Thanks! r9905 in 2.0 branch, r9906 in trunk