summaryrefslogtreecommitdiff
path: root/src/include/utils/numeric.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-09-25 22:21:55 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-09-25 22:21:55 +0000
commitf828f878e96b83cc50569305e2f2eccfde1e8181 (patch)
tree35ba9fbb88249091cafc9bf8d379d3e5856eeade /src/include/utils/numeric.h
parent7a315a09dc0f7a1f903b89022a2a833c1719145b (diff)
downloadpostgresql-f828f878e96b83cc50569305e2f2eccfde1e8181.tar.gz
Change on-disk representation of NUMERIC datatype so that the sign_dscale
word comes before the weight instead of after. This will allow future binary-compatible extension of the representation to support compact formats, as discussed on pgsql-hackers around 2007/06/18. The reason to do it now is that we've already pretty well broken any chance of simple in-place upgrade from 8.2 to 8.3, but it's possible that 8.3 to 8.4 (or whenever we get around to squeezing NUMERIC) could otherwise be data-compatible.
Diffstat (limited to 'src/include/utils/numeric.h')
-rw-r--r--src/include/utils/numeric.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index cffba1e164..e14251591e 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -7,7 +7,7 @@
*
* Copyright (c) 1998-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.24 2007/02/27 23:48:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.25 2007/09/25 22:21:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -63,14 +63,14 @@
typedef struct NumericData
{
int32 vl_len_; /* varlena header (do not touch directly!) */
- int16 n_weight; /* Weight of 1st digit */
uint16 n_sign_dscale; /* Sign + display scale */
+ int16 n_weight; /* Weight of 1st digit */
char n_data[1]; /* Digits (really array of NumericDigit) */
} NumericData;
typedef NumericData *Numeric;
-#define NUMERIC_HDRSZ (VARHDRSZ + sizeof(int16) + sizeof(uint16))
+#define NUMERIC_HDRSZ (VARHDRSZ + sizeof(uint16) + sizeof(int16))
/*