summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2007-09-25 22:21:55 +0000
committerTom Lane2007-09-25 22:21:55 +0000
commitfc0ee062aafa5ec800dc0461387c3b01ca3d85ec (patch)
treef27a07e2d72e5cd41fee5737f140239448724ffe
parentb71d0cdd4a279329b05b0699e1fb53802f30e46b (diff)
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.
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/utils/numeric.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 31421abb94..3a897c72bb 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200709241
+#define CATALOG_VERSION_NO 200709251
#endif
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index 3e02c40b16..589e2f5bda 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -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))
/*