[postgis-devel] probe_geometry_columns

Markus Schaber schabi at logix-tt.com
Wed Apr 26 08:10:15 PDT 2006


Hi, Kevin,

Kevin Neufeld wrote:

> I cut and pasted the code from that I sent on April 12 into a 8.1
> instance and didn't have any problems. Unfortunately, I don't have a 8.0
> instance at my ready to test against that.
> 
> The only thing I can think of is that your email client is adding funny
> characters at line breaks or something.

It works for me, too, against:
PostgreSQL 8.1.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3
(Debian 4.0.3-1)
POSTGIS="1.1.1CVS" GEOS="2.2.1" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS

However, I get a warning:

WARNING:  nonstandard use of \' in a string literal at character 46
HINT:  Use '' to write quotes in strings, or use the escape string
syntax (E'...').
QUERY:  SELECT  (SELECT replace(split_part(s.consrc, '\'', 2), ')', '')
FROM pg_class c, pg_namespace n, pg_attribute a, pg_constraint s WHERE
n.nspname =  $1  AND c.relname =  $2  AND a.attname =  $3  AND
a.attrelid = c.oid AND s.connamespace = n.oid AND s.conrelid = c.oid AND
a.attnum = ANY (s.conkey) AND s.consrc LIKE '%geometrytype(% = %')
CONTEXT:  SQL statement in PL/PgSQL function "populate_geometry_columns"
near line 129

So to be safe for older PostgreSQL versions which don't support the E''
syntax, you should use '' for escaping 's.


HTH,
Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



More information about the postgis-devel mailing list