[postgis-devel] Recent changes in PostgreSQL 8.2devel

Michael Fuhr mike at fuhr.org
Sun Jul 2 07:41:07 PDT 2006


A recent commit to PostgreSQL HEAD (8.2devel) changes the call
signature of the gistentryinit() macro.  One of the parameters has
been removed; see the bottom of the second link below for the actual
change:

http://archives.postgresql.org/pgsql-committers/2006-06/msg00380.php
http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/gist.h.diff?r1=1.53&r2=1.54

As a result PostGIS now fails to build against 8.2devel:

lwgeom_gist.c:548:10: macro "gistentryinit" passed 7 arguments, but takes just 6
lwgeom_gist.c:545: error: `gistentryinit' undeclared (first use in this function)
lwgeom_gist.c:545: error: (Each undeclared identifier is reported only once
lwgeom_gist.c:545: error: for each function it appears in.)
lwgeom_gist.c:557:41: macro "gistentryinit" passed 7 arguments, but takes just 6

I removed the penultimate argument per the change to gistentryinit();
the PostGIS build then succeeded and passed all tests except for a
minor diff resulting from escape_string_warning being on (see below).
This isn't a problem yet since 8.2 is still in development, but
eventually this version-specific change will need attention.

Another change was made some time ago but I only recently noticed
its impact on PostGIS.  In PostgreSQL 8.2devel escape_string_warning
defaults to on, which causes warnings when loading lwpostgis.sql
or lwpostgis_upgrade.sql.  For example:

psql:lwpostgis_upgrade.sql:1467: WARNING:  nonstandard use of \' in a string literal
LINE 2:         AS 'SELECT \'1.1.3\'::text AS version'
                   ^
HINT:  Use '' to write quotes in strings, or use the escape string syntax (E'...').

The E'...' syntax isn't supported in versions of PostgreSQL prior
to 8.1; a backward-compatible fix would be to replace \' with ''
and escapes like '\n' with a function call like chr(10).  I'll take
a closer look at this when I get a chance.

-- 
Michael Fuhr



More information about the postgis-devel mailing list