ifneq ($(findstring 7.4,$(VERSION)),)
USE_VERSION=74
else
- USE_VERSION=75
+ USE_VERSION=80
endif
endif
endif
ifneq ($(findstring 7.4,$(VERSION)),)
USE_VERSION=74
else
- USE_VERSION=75
+ USE_VERSION=80
endif
endif
endif
PG_FUNCTION_INFO_V1(lwgeom_box_union);
Datum lwgeom_box_union(PG_FUNCTION_ARGS)
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
bytea *entryvec = (bytea *) PG_GETARG_POINTER(0);
#else
GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
elog(NOTICE,"GIST: lwgeom_box_union called\n");
#endif
-#if USE_VERSION < 75
+#if USE_VERSION < 80
numranges = (VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY);
cur = (BOX2DFLOAT4 *) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[0].key);
#else
for (i = 1; i < numranges; i++)
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[i].key);
#else
cur = (BOX2DFLOAT4*) DatumGetPointer(entryvec->vector[i].key);
PG_FUNCTION_INFO_V1(lwgeom_gbox_picksplit);
Datum lwgeom_gbox_picksplit(PG_FUNCTION_ARGS)
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
bytea *entryvec = (bytea *) PG_GETARG_POINTER(0);
#else
GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
posL = posR = posB = posT = 0;
-#if USE_VERSION < 75
+#if USE_VERSION < 80
maxoff = ((VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY)) - 1;
cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[FirstOffsetNumber].key);
#else
/* find MBR */
for (i = OffsetNumberNext(FirstOffsetNumber); i <= maxoff; i = OffsetNumberNext(i))
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[i].key);
#else
cur = (BOX2DFLOAT4 *) DatumGetPointer(entryvec->vector[i].key);
#ifdef DEBUG_GIST6
elog(NOTICE," AllIsEqual!");
#endif
-#if USE_VERSION < 75
+#if USE_VERSION < 80
cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[OffsetNumberNext(FirstOffsetNumber)].key);
#else
cur = (BOX2DFLOAT4*) DatumGetPointer(entryvec->vector[OffsetNumberNext(FirstOffsetNumber)].key);
for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
cur = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[i].key);
#else
cur = (BOX2DFLOAT4*) DatumGetPointer(entryvec->vector[i].key);
KBsort *arr = (KBsort*)palloc( sizeof(KBsort) * maxoff );
posL = posR = posB = posT = 0;
for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) {
-#if USE_VERSION < 75
+#if USE_VERSION < 80
arr[i-1].key = (BOX2DFLOAT4*) DatumGetPointer(((GISTENTRY *) VARDATA(entryvec))[i].key);
#else
arr[i-1].key = (BOX2DFLOAT4*) DatumGetPointer(entryvec->vector[i].key);
*
**********************************************************************
* $Log$
+ * Revision 1.50 2004/08/19 06:15:58 strk
+ * USE_VERSION gets 80 where it got 75
+ *
* Revision 1.49 2004/07/28 13:37:43 strk
* Added postgis_uses_stats and postgis_scripts_version.
* Experimented with PIP short-circuit in within/contains functions.
Datum explode_histogram2d(PG_FUNCTION_ARGS);
Datum estimate_histogram2d(PG_FUNCTION_ARGS);
-#if USE_VERSION >= 75
+#if USE_VERSION >= 80
Datum geometry_analyze(PG_FUNCTION_ARGS);
#endif
AS '@MODULE_FILENAME@'
LANGUAGE 'C' WITH (isstrict);
-#if USE_VERSION >= 75
+#if USE_VERSION >= 80
CREATEFUNCTION geometry_analyze(internal)
RETURNS bool
AS '@MODULE_FILENAME@'
internallength = variable,
input = geometry_in,
output = geometry_out,
-#if USE_VERSION >= 75
+#if USE_VERSION >= 80
analyze = geometry_analyze,
#endif
storage = main
coord_dimension integer not null,
srid integer not null,
type varchar(30) not null,
-#if USE_VERSION < 75
+#if USE_VERSION < 80
attrelid oid,
varattnum int,
stats histogram2d,
-- (for PG>=73)
--
-- o link records to system tables through attrelid and varattnum
--- (for PG<75)
+-- (for PG<80)
--
-- o delete all records for which no linking was possible
--- (for PG<75)
+-- (for PG<80)
--
--
-----------------------------------------------------------------------
GET DIAGNOSTICS foundschema = ROW_COUNT;
#endif
-#if USE_VERSION >= 75
+#if USE_VERSION >= 80
-- no linkage to system table needed
return ''fixed:''||foundschema::text;
#endif
strpos(typecheck.consrc, ''::'')-
strpos(typecheck.consrc, ''='')
))::varchar as type,
-#if USE_VERSION < 75
+#if USE_VERSION < 80
a.attrelid,
a.attnum as varattnum,
null::histogram2d as stats
-- UPDATE_GEOMETRY_STATS()
-----------------------------------------------------------------------
--
--- Only meaningful for PG<75.
+-- Only meaningful for PG<80.
-- Gather statisticts about geometry columns for use
-- with cost estimator.
--
--- It is defined also for PG>=75 for back-compatibility
+-- It is defined also for PG>=80 for back-compatibility
--
-----------------------------------------------------------------------
-#if USE_VERSION >= 75
+#if USE_VERSION >= 80
CREATEFUNCTION update_geometry_stats() RETURNS text
AS ' SELECT ''update_geometry_stats() has been obsoleted. Statistics are automatically built running the ANALYZE command''::text' LANGUAGE 'sql';
-#else // USE_VERSION < 75
+#else // USE_VERSION < 80
CREATEFUNCTION update_geometry_stats()
RETURNS text
AS
END;
'
LANGUAGE 'plpgsql' ;
-#endif // USE_VERSION < 75
+#endif // USE_VERSION < 80
-----------------------------------------------------------------------
-- UPDATE_GEOMETRY_STATS( <table>, <column> )
-----------------------------------------------------------------------
--
--- Only meaningful for PG<75.
+-- Only meaningful for PG<80.
-- Gather statisticts about a geometry column for use
-- with cost estimator.
--
--- It is defined also for PG>=75 for back-compatibility
+-- It is defined also for PG>=80 for back-compatibility
--
-----------------------------------------------------------------------
-#if USE_VERSION >= 75
+#if USE_VERSION >= 80
CREATEFUNCTION update_geometry_stats(varchar,varchar) RETURNS text
AS 'SELECT update_geometry_stats();' LANGUAGE 'sql' ;
#else
'
LANGUAGE 'plpgsql' ;
-#endif // USE_VERSION < 75
+#endif // USE_VERSION < 80
-----------------------------------------------------------------------
-- CREATE_HISTOGRAM2D( <box>, <size> )
*
**********************************************************************
* $Log$
+ * Revision 1.31 2004/08/19 06:15:58 strk
+ * USE_VERSION gets 80 where it got 75
+ *
* Revision 1.30 2004/08/16 11:03:25 mcayland
* Added DLLIMPORT reference to "default_statistics_target" if we are compiling under Win32. This should make it unnecessary to apply Romi's patch to the PostgreSQL source tree when compiling PostgreSQL ready for PostGIS.
*
#include "executor/spi.h"
-#if USE_VERSION >= 75
+#if USE_VERSION >= 80
#include "commands/vacuum.h"
-#if USE_VERSION < 75
+#if USE_VERSION < 80
/*
* get_restriction_var
* Examine the args of a restriction clause to see if it's of the
PG_RETURN_VOID();
}
-#else // USE_VERSION >= 75
+#else // USE_VERSION >= 80
/*
* This function returns an estimate of the selectivity
*
**********************************************************************
* $Log$
+ * Revision 1.19 2004/08/19 06:15:58 strk
+ * USE_VERSION gets 80 where it got 75
+ *
* Revision 1.18 2004/06/09 10:19:06 strk
* Moved changes needed for PG75 inside postgis_gist_72.c using #if switches.
*
PG_FUNCTION_INFO_V1(gbox_union);
Datum gbox_union(PG_FUNCTION_ARGS)
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
bytea *entryvec = (bytea *) PG_GETARG_POINTER(0);
#else
GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
fflush( stdout );
#endif
-#if USE_VERSION < 75
+#if USE_VERSION < 80
numranges = (VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY);
cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[0].key);
#else
for (i = 1; i < numranges; i++)
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[i].key);
#else
cur = DatumGetBoxP(entryvec->vector[i].key);
Datum
gbox_picksplit(PG_FUNCTION_ARGS)
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
bytea *entryvec = (bytea *) PG_GETARG_POINTER(0);
#else
GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
#endif
posL = posR = posB = posT = 0;
-#if USE_VERSION < 75
+#if USE_VERSION < 80
maxoff = ((VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY)) - 1;
cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[FirstOffsetNumber].key);
#else
/* find MBR */
for (i = OffsetNumberNext(FirstOffsetNumber); i <= maxoff; i = OffsetNumberNext(i))
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[i].key);
#else
cur = DatumGetBoxP(entryvec->vector[i].key);
unionR = (BOX *) palloc(sizeof(BOX));
if (allisequal)
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[OffsetNumberNext(FirstOffsetNumber)].key);
#else
cur = DatumGetBoxP(entryvec->vector[OffsetNumberNext(FirstOffsetNumber)].key);
for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
{
-#if USE_VERSION < 75
+#if USE_VERSION < 80
cur = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[i].key);
#else
cur = DatumGetBoxP(entryvec->vector[i].key);
KBsort *arr = (KBsort*)palloc( sizeof(KBsort) * maxoff );
posL = posR = posB = posT = 0;
for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) {
-#if USE_VERSION < 75
+#if USE_VERSION < 80
arr[i-1].key = DatumGetBoxP(((GISTENTRY *) VARDATA(entryvec))[i].key);
#else
arr[i-1].key = DatumGetBoxP(entryvec->vector[i].key);