Skip to content

Commit f828f87

Browse files
committed
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.
1 parent 7a315a0 commit f828f87

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.428 2007/09/25 20:03:38 tgl Exp $
40+
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.429 2007/09/25 22:21:55 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 200709241
56+
#define CATALOG_VERSION_NO 200709251
5757

5858
#endif

src/include/utils/numeric.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1998-2007, PostgreSQL Global Development Group
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.24 2007/02/27 23:48:10 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.25 2007/09/25 22:21:55 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -63,14 +63,14 @@
6363
typedef struct NumericData
6464
{
6565
int32 vl_len_; /* varlena header (do not touch directly!) */
66-
int16 n_weight; /* Weight of 1st digit */
6766
uint16 n_sign_dscale; /* Sign + display scale */
67+
int16 n_weight; /* Weight of 1st digit */
6868
char n_data[1]; /* Digits (really array of NumericDigit) */
6969
} NumericData;
7070

7171
typedef NumericData *Numeric;
7272

73-
#define NUMERIC_HDRSZ (VARHDRSZ + sizeof(int16) + sizeof(uint16))
73+
#define NUMERIC_HDRSZ (VARHDRSZ + sizeof(uint16) + sizeof(int16))
7474

7575

7676
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy