summaryrefslogtreecommitdiff
path: root/contrib/ltree/_ltree_gist.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-08-26 17:54:02 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-08-26 17:54:02 +0000
commit5cabcfccce4b8b826c9b30828f3012b7926a6946 (patch)
tree3e14c0710a45b4195734dd3189eb89eac4969073 /contrib/ltree/_ltree_gist.c
parent8009c275925dda90f1275ba70f5c2a63abaa520b (diff)
downloadpostgresql-5cabcfccce4b8b826c9b30828f3012b7926a6946.tar.gz
Modify array operations to include array's element type OID in the
array header, and to compute sizing and alignment of array elements the same way normal tuple access operations do --- viz, using the tupmacs.h macros att_addlength and att_align. This makes the world safe for arrays of cstrings or intervals, and should make it much easier to write array-type-polymorphic functions; as examples see the cleanups of array_out and contrib/array_iterator. By Joe Conway and Tom Lane.
Diffstat (limited to 'contrib/ltree/_ltree_gist.c')
-rw-r--r--contrib/ltree/_ltree_gist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c
index 8b7420e6d9..27bd057a56 100644
--- a/contrib/ltree/_ltree_gist.c
+++ b/contrib/ltree/_ltree_gist.c
@@ -59,7 +59,7 @@ _ltree_compress(PG_FUNCTION_ARGS) {
if ( entry->leafkey ) { /* ltree */
ltree_gist *key;
- ArrayType *val = (ArrayType*)DatumGetPointer(PG_DETOAST_DATUM(entry->key));
+ ArrayType *val = DatumGetArrayTypeP(entry->key);
int4 len = LTG_HDRSIZE + ASIGLEN;
int num=ArrayGetNItems( ARR_NDIM(val), ARR_DIMS(val) );
ltree *item = (ltree*)ARR_DATA_PTR(val);