This patch moves GiST implementation details from gist.h into a new
header file, gist_private.h. gist.h should only contain APIs that are
exposed to clients writing GiST extensions -- where possible we should
avoid backward-incompatible changes to those APIs, so it makes sense to
keep that API in a separate file.
Other related changes:
- pruned down the list of unnecessary includes in gist.h; as a result I
had to add a missing #include to contrib/cube/cube.c
- remove isAttByVal(), which is no longer used
- remove declaration of _gistdump(), which is never defined
I noticed that GISTNStrategies is defined, but never used; instead there
is a literal "100" in include/catalog/pg_am.h. Does anyone see a reason
to keep GISTNStrategies around? Alternatively, should pg_am.h include
gist.h and reference GISTNStrategies instead of using "100"?
All of contrib/ continues to compile without warnings with this patch; I
haven't tried externally maintained GiST extensions, but they may need a
bit of #include tweaking.
Barring any objections I'll apply this later today or tomorrow.
-Neil
Index: contrib/cube/cube.c
===
RCS file: /var/lib/cvs/pgsql/contrib/cube/cube.c,v
retrieving revision 1.18
diff -c -r1.18 cube.c
*** contrib/cube/cube.c 21 Oct 2004 19:28:33 - 1.18
--- contrib/cube/cube.c 17 May 2005 01:54:22 -
***
*** 6,11
--- 6,12
#include "postgres.h"
+ #include
#include
#include "access/gist.h"
Index: src/backend/access/gist/gist.c
===
RCS file: /var/lib/cvs/pgsql/src/backend/access/gist/gist.c,v
retrieving revision 1.116
diff -c -r1.116 gist.c
*** src/backend/access/gist/gist.c 17 May 2005 00:59:30 - 1.116
--- src/backend/access/gist/gist.c 17 May 2005 01:49:26 -
***
*** 15,21
#include "postgres.h"
#include "access/genam.h"
! #include "access/gist.h"
#include "access/gistscan.h"
#include "access/heapam.h"
#include "catalog/index.h"
--- 15,21
#include "postgres.h"
#include "access/genam.h"
! #include "access/gist_private.h"
#include "access/gistscan.h"
#include "access/heapam.h"
#include "catalog/index.h"
***
*** 26,35
#undef GIST_PAGEADDITEM
! #define ATTSIZE(datum, TupDesc, i, isnull) \
( \
(isnull) ? 0 : \
! att_addlength(0, (TupDesc)->attrs[(i)-1]->attlen, (datum)) \
)
/* result's status */
--- 26,35
#undef GIST_PAGEADDITEM
! #define ATTSIZE(datum, tupdesc, i, isnull) \
( \
(isnull) ? 0 : \
! att_addlength(0, (tupdesc)->attrs[(i)-1]->attlen, (datum)) \
)
/* result's status */
Index: src/backend/access/gist/gistget.c
===
RCS file: /var/lib/cvs/pgsql/src/backend/access/gist/gistget.c,v
retrieving revision 1.46
diff -c -r1.46 gistget.c
*** src/backend/access/gist/gistget.c 17 May 2005 00:59:30 - 1.46
--- src/backend/access/gist/gistget.c 17 May 2005 01:28:51 -
***
*** 14,20
*/
#include "postgres.h"
! #include "access/gist.h"
#include "executor/execdebug.h"
#include "utils/memutils.h"
--- 14,21
*/
#include "postgres.h"
! #include "access/gist_private.h"
! #include "access/itup.h"
#include "executor/execdebug.h"
#include "utils/memutils.h"
Index: src/backend/access/gist/gistscan.c
===
RCS file: /var/lib/cvs/pgsql/src/backend/access/gist/gistscan.c,v
retrieving revision 1.57
diff -c -r1.57 gistscan.c
*** src/backend/access/gist/gistscan.c 17 May 2005 00:59:30 - 1.57
--- src/backend/access/gist/gistscan.c 17 May 2005 01:16:46 -
***
*** 15,21
#include "postgres.h"
#include "access/genam.h"
! #include "access/gist.h"
#include "access/gistscan.h"
#include "utils/memutils.h"
#include "utils/resowner.h"
--- 15,21
#include "postgres.h"
#include "access/genam.h"
! #include "access/gist_private.h"
#include "access/gistscan.h"
#include "utils/memutils.h"
#include "utils/resowner.h"
Index: src/backend/access/transam/rmgr.c
===
RCS file: /var/lib/cvs/pgsql/src/backend/access/transam/rmgr.c,v
retrieving revision 1.16
diff -c -r1.16 rmgr.c
*** src/backend/access/transam/rmgr.c 29 Aug 2004 21:08:47 - 1.16
--- src/backend/access/transam/rmgr.c 17 May 2005 01:19:48 -
***
*** 8,14
#include "postgres.h"
#include "access/clog.h"
! #include "access/gist.h"
#include "access/hash.h"
#include "access/heapam.h"
#include "access/nbtree.h"
--- 8,14
#include "postgres.h"
#include "access/clog.h"
! #include "access/gist_private.h"
#include "access/hash.h"
#include "access/heapam.h"
#include "access/nbtree.h"
Index: src/include/access/gist.h
==