[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    [postgis-users] shp2pgsql: Escaping '\', creategisdb
From:       Steffen Macke <sdteffen () web ! de>
Date:       2002-06-12 17:02:29
Message-ID: 200206122002.29638.sdteffen () web ! de
[Download RAW message or body]

Dear PostGIS users,

I had a problem loading a shapefile that contained strings
with '\', the character is not escaped by the loader.
Looking at
shp2pgsql.c, line 106:
	if ( (str2 == str) || (str2[-1] != '\\') ) //the previous char isnt a '\'
I wonder wether "'" should be escaped on the shapefile level?
Shouldn't "'" be also escaped if it is following "\"? Of course,
all "\" should be escaped as well. That's what I would like to add once
I'm clear about the special handling of "\'".
Tab escaping for the dump format loader seems to have a similar
problem.
Anything else that has to be escaped?

I think it would be nicel to have a command similar to
'createdb' that creates a new Postgresql db ready for PostGIS use.
This can be established by a simple shell script:
************
#create a Postgresql db and set it up for PostGIS
createdb $1
createlang plpgsql $1
psql -d $1 -f /usr/share/postgresql/contrib/postgis.sql
************
Do you think such a script is useful? I would than try to create a 
creategisdb.in file that is used to create 'creategisdb'  in the make process 
with the updated path to postgis.sql

Steffen




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic