postgis_scripts_released() will return the same as postgis_lib_version()
postgis_scripts_installed() return still the same numbers but as written
in the database at the time of lwpostgis.sql sourcing.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2211
b70326c6-7e19-0410-871a-
916f4a2858ee
- postgis_version() made a C function
- produced lwpostgis_upgrade.sql as part of the build process
- old jdbc code removed from release
+ - obsoleted direct use of postgis_proc_upgrade.pl
+ - scripts version unified with release version
PostGIS 1.0.6
2005/12/06
SO_MINOR_VERSION=1
SO_MICRO_VERSION=0CVS
-# sql scripts version
-SCRIPTS_MAJOR_VERSION=0
-SCRIPTS_MINOR_VERSION=3
-SCRIPTS_MICRO_VERSION=1
-
# JDBC code version
JDBC_MAJOR_VERSION=1
JDBC_MINOR_VERSION=1
POSTGIS_VERSION = $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) USE_GEOS=$(USE_GEOS) USE_PROJ=$(USE_PROJ) USE_STATS=$(USE_STATS)
POSTGIS_LIB_VERSION = $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_MICRO_VERSION)
POSTGIS_BUILD_DATE := $(shell date -u "+%Y-%m-%d %H:%M:%S")
-SCRIPTS_VERSION=$(SCRIPTS_MAJOR_VERSION).$(SCRIPTS_MINOR_VERSION).$(SCRIPTS_MICRO_VERSION)
+SCRIPTS_VERSION=$(POSTGIS_LIB_VERSION)
#---------------------------------------------------------------
AS '@MODULE_FILENAME@'
LANGUAGE 'C' _IMMUTABLE;
+--
+-- IMPORTANT:
+-- Starting at 1.1.0 this function is used by postgis_proc_upgrade.pl
+-- to extract version of postgis being installed.
+-- 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;
AS '@MODULE_FILENAME@'
LANGUAGE 'C' _IMMUTABLE; -- a new lib will require a new session
+-- NOTE: starting at 1.1.0 this is the same of postgis_lib_version()
CREATEFUNCTION postgis_scripts_released() RETURNS text
AS '@MODULE_FILENAME@'
LANGUAGE 'C' _IMMUTABLE;
fullver = fullver || \' USE_STATS\';
END IF;
- fullver = fullver || \' DBPROC="\' || dbproc || \'"\';
- fullver = fullver || \' RELPROC="\' || relproc || \'"\';
+ -- fullver = fullver || \' DBPROC="\' || dbproc || \'"\';
+ -- fullver = fullver || \' RELPROC="\' || relproc || \'"\';
IF dbproc != relproc THEN
fullver = fullver || \' (needs proc upgrade)\';
use strict;
($#ARGV == 0) ||
-die "Usage: perl postgis_funxupgrade.pl <postgis.sql> [<schema>]\nCreates a new SQL script to upgrade all of the PostGIS functions.\n"
+die "Usage: perl postgis_proc_upgrade.pl <postgis.sql> [<schema>]\nCreates a new SQL script to upgrade all of the PostGIS functions.\n"
if ( @ARGV < 1 || @ARGV > 2 );
my $NEWVERSION = "UNDEF";
FUNC:
while(<INPUT>)
{
+ #
+ # Since 1.1.0 scripts/lib/release versions are the same
+ #
if (m/^create or replace function postgis_scripts_installed()/i)
{
while(<INPUT>)
{
- if ( m/SELECT .'(\d\.\d\.\d).'::text/i )
+ if ( m/SELECT .'(\d\.\d\..*).'::text/i )
{
$NEWVERSION = $1;
last FUNC;
__END__
-CREATE OR REPLACE FUNCTION postgis_script_version_check()
+CREATE OR REPLACE FUNCTION postgis_major_version_check()
RETURNS text
AS '
DECLARE
old_majmin text;
new_majmin text;
BEGIN
- SELECT into old_scripts postgis_scripts_installed();
+ SELECT into old_scripts postgis_lib_version();
SELECT into new_scripts ''NEWVERSION'';
SELECT into old_majmin substring(old_scripts from 1 for 4);
SELECT into new_majmin substring(new_scripts from 1 for 4);
'
LANGUAGE 'plpgsql';
-SELECT postgis_script_version_check();
+SELECT postgis_major_version_check();
-DROP FUNCTION postgis_script_version_check();
+DROP FUNCTION postgis_major_version_check();