summaryrefslogtreecommitdiff
path: root/src/include/catalog/pg_opclass.h
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2007-05-08 18:56:48 +0000
committerNeil Conway <neilc@samurai.com>2007-05-08 18:56:48 +0000
commitade493e02d25f4807c02dcd763a25d4232b3b68d (patch)
treea234ff952a89a742ceb5b668adc31fc0e0ddbbda /src/include/catalog/pg_opclass.h
parent97f796942fe529ed080a6b1695ec00fa19dfb191 (diff)
downloadpostgresql-ade493e02d25f4807c02dcd763a25d4232b3b68d.tar.gz
Add a hash function for "numeric". Mark the equality operator for
numerics as "oprcanhash", and make the corresponding system catalog updates. As a result, hash indexes, hashed aggregation, and hash joins can now be used with the numeric type. Bump the catversion. The only tricky aspect to doing this is writing a correct hash function: it's possible for two Numerics to be equal according to their equality operator, but have different in-memory bit patterns. To cope with this, the hash function doesn't consider the Numeric's "scale" or "sign", and explictly skips any leading or trailing zeros in the Numeric's digit buffer (the current implementation should suppress any such zeros, but it seems unwise to rely upon this). See discussion on pgsql-patches for more details.
Diffstat (limited to 'src/include/catalog/pg_opclass.h')
-rw-r--r--src/include/catalog/pg_opclass.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h
index 2df9b8241a..28fed11301 100644
--- a/src/include/catalog/pg_opclass.h
+++ b/src/include/catalog/pg_opclass.h
@@ -28,7 +28,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.75 2007/04/02 03:49:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.76 2007/05/08 18:56:47 neilc Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -129,6 +129,7 @@ DATA(insert ( 405 macaddr_ops PGNSP PGUID 1985 829 t 0 ));
DATA(insert ( 403 name_ops PGNSP PGUID 1986 19 t 0 ));
DATA(insert ( 405 name_ops PGNSP PGUID 1987 19 t 0 ));
DATA(insert ( 403 numeric_ops PGNSP PGUID 1988 1700 t 0 ));
+DATA(insert ( 405 numeric_ops PGNSP PGUID 1998 1700 t 0 ));
DATA(insert OID = 1981 ( 403 oid_ops PGNSP PGUID 1989 26 t 0 ));
#define OID_BTREE_OPS_OID 1981
DATA(insert ( 405 oid_ops PGNSP PGUID 1990 26 t 0 ));