[postgis-devel] Recent changes in PostgreSQL 8.2devel

Michael Fuhr mike at fuhr.org
Thu Jul 6 22:13:56 PDT 2006


On Sun, Jul 02, 2006 at 05:22:34PM -0600, Michael Fuhr wrote:
> Here's a patch for the gistentryinit() problem; it builds and passes
> regression tests under 8.1 and 8.2devel.  I'll submit a separate
> patch to deal with escape_string_warning.

Here are a couple of patches that eliminate the warnings that
escape_string_warning complains about.  The patches change \'
(backslash single-quote) to '' (single-quote single-quote) and
replace a couple of other escapes with calls to chr().

-- 
Michael Fuhr
-------------- next part --------------
Index: lwgeom/lwpostgis.sql.in
===================================================================
RCS file: /home/cvs/postgis/postgis/lwgeom/lwpostgis.sql.in,v
retrieving revision 1.159
diff -c -r1.159 lwpostgis.sql.in
*** lwgeom/lwpostgis.sql.in	25 Jun 2006 23:59:32 -0000	1.159
--- lwgeom/lwpostgis.sql.in	7 Jul 2006 04:50:17 -0000
***************
*** 2041,2047 ****
  		table_name || ''.'' || column_name ||
  		'' SRID:'' || new_srid ||
  		'' TYPE:'' || new_type || 
! 		'' DIMS:'' || new_dim || ''\n ''; 
  END;
  '
  LANGUAGE 'plpgsql' _VOLATILE_STRICT; -- WITH (isstrict);
--- 2041,2047 ----
  		table_name || ''.'' || column_name ||
  		'' SRID:'' || new_srid ||
  		'' TYPE:'' || new_type || 
! 		'' DIMS:'' || new_dim || chr(10) || '' ''; 
  END;
  '
  LANGUAGE 'plpgsql' _VOLATILE_STRICT; -- WITH (isstrict);
***************
*** 2623,2629 ****
  -- Do not modify this w/out also changing postgis_proc_upgrade.pl
  --
  CREATEFUNCTION postgis_scripts_installed() RETURNS text
!         AS 'SELECT \'@POSTGIS_SCRIPTS_VERSION@\'::text AS version'
          LANGUAGE 'sql' _IMMUTABLE;
  
  CREATEFUNCTION postgis_lib_version() RETURNS text
--- 2623,2629 ----
  -- Do not modify this w/out also changing postgis_proc_upgrade.pl
  --
  CREATEFUNCTION postgis_scripts_installed() RETURNS text
!         AS 'SELECT ''@POSTGIS_SCRIPTS_VERSION@''::text AS version'
          LANGUAGE 'sql' _IMMUTABLE;
  
  CREATEFUNCTION postgis_lib_version() RETURNS text
***************
*** 2648,2654 ****
  	LANGUAGE 'C' _IMMUTABLE;
  
  CREATEFUNCTION postgis_scripts_build_date() RETURNS text
!         AS 'SELECT \'@POSTGIS_BUILD_DATE@\'::text AS version'
          LANGUAGE 'sql' _IMMUTABLE;
  
  CREATEFUNCTION postgis_lib_build_date() RETURNS text
--- 2648,2654 ----
  	LANGUAGE 'C' _IMMUTABLE;
  
  CREATEFUNCTION postgis_scripts_build_date() RETURNS text
!         AS 'SELECT ''@POSTGIS_BUILD_DATE@''::text AS version'
          LANGUAGE 'sql' _IMMUTABLE;
  
  CREATEFUNCTION postgis_lib_build_date() RETURNS text
***************
*** 2677,2705 ****
  	SELECT postgis_scripts_installed() INTO dbproc;
  	SELECT postgis_scripts_released() INTO relproc;
  
! 	fullver = \'POSTGIS="\' || libver || \'"\';
  
  	IF  geosver IS NOT NULL THEN
! 		fullver = fullver || \' GEOS="\' || geosver || \'"\';
  	END IF;
  
  	IF  jtsver IS NOT NULL THEN
! 		fullver = fullver || \' JTS="\' || jtsver || \'"\';
  	END IF;
  
  	IF  projver IS NOT NULL THEN
! 		fullver = fullver || \' PROJ="\' || projver || \'"\';
  	END IF;
  
  	IF usestats THEN
! 		fullver = fullver || \' USE_STATS\';
  	END IF;
  
! 	-- fullver = fullver || \' DBPROC="\' || dbproc || \'"\';
! 	-- fullver = fullver || \' RELPROC="\' || relproc || \'"\';
  
  	IF dbproc != relproc THEN
! 		fullver = fullver || \' (procs from \' || dbproc || \' need upgrade)\';
  	END IF;
  
  	RETURN fullver;
--- 2677,2705 ----
  	SELECT postgis_scripts_installed() INTO dbproc;
  	SELECT postgis_scripts_released() INTO relproc;
  
! 	fullver = ''POSTGIS="'' || libver || ''"'';
  
  	IF  geosver IS NOT NULL THEN
! 		fullver = fullver || '' GEOS="'' || geosver || ''"'';
  	END IF;
  
  	IF  jtsver IS NOT NULL THEN
! 		fullver = fullver || '' JTS="'' || jtsver || ''"'';
  	END IF;
  
  	IF  projver IS NOT NULL THEN
! 		fullver = fullver || '' PROJ="'' || projver || ''"'';
  	END IF;
  
  	IF usestats THEN
! 		fullver = fullver || '' USE_STATS'';
  	END IF;
  
! 	-- fullver = fullver || '' DBPROC="'' || dbproc || ''"'';
! 	-- fullver = fullver || '' RELPROC="'' || relproc || ''"'';
  
  	IF dbproc != relproc THEN
! 		fullver = fullver || '' (procs from '' || dbproc || '' need upgrade)'';
  	END IF;
  
  	RETURN fullver;
-------------- next part --------------
Index: lwgeom/long_xact.sql
===================================================================
RCS file: /home/cvs/postgis/postgis/lwgeom/long_xact.sql,v
retrieving revision 1.1
diff -c -r1.1 long_xact.sql
*** lwgeom/long_xact.sql	25 Jun 2006 23:59:32 -0000	1.1
--- lwgeom/long_xact.sql	7 Jul 2006 04:50:59 -0000
***************
*** 286,292 ****
  			''n.nspname as schema, '' ||
  #endif
  			''c.relname as table, trim('' ||
! 			quote_literal(''\\\\000'') ||
  			'' from t.tgargs) as id_column '' ||
  			''FROM pg_trigger t, pg_class c, pg_proc p '' ||
  #ifdef HAS_SCHEMAS
--- 286,292 ----
  			''n.nspname as schema, '' ||
  #endif
  			''c.relname as table, trim('' ||
! 			quote_literal(chr(92) || ''000'') ||
  			'' from t.tgargs) as id_column '' ||
  			''FROM pg_trigger t, pg_class c, pg_proc p '' ||
  #ifdef HAS_SCHEMAS


More information about the postgis-devel mailing list