[postgis-users] Shp2Pgsql - how to handle carriage returns ?

Dave Fuhry dfuhry at gmail.com
Mon Apr 6 15:56:20 PDT 2009


I use the attached patch, which tweaks shp2pgsql to handle newlines
(\n) and carriage returns (\r), replaces hi-bit characters with a
question mark, and removes some geometry checks.

You probably only want to do the first of those three.  In that case,
the patch should be easy to modify.  Hope you find it helpful.

-Dave

On Fri, Apr 3, 2009 at 9:21 AM, Ivan Mincik <ivan.mincik at gmail.com> wrote:
> On Friday 03 April 2009, Stefan Schwarzer wrote:
>> Hi there,
>>
>> I have a shapefile I would like to import into my database, but the
>> shp2pgsql seems to have problems with carriage returns in the DBF:
>>
>>       ERROR:  literal carriage return found in data
>>       HINT:  Use "\r" to represent carriage return.
>>
>> What can I do about it? I don't see any solution, other than deleting
>> the column where this occurs. But that's not very cool...
>>
>> Thanks for any hints,
>>
>> Stef
> Try to do not use dump format ( don't use parameter -D).  shp2pgsql will use simple INSERT INTO command. It will take longer time to import, but it can solve your problem.
> Ivan
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shp2pgsql_nogeomerrchk_replacehibit_fixnlbr.patch
Type: text/x-patch
Size: 2396 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090406/8c68b0e4/attachment.bin>


More information about the postgis-users mailing list