Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5553d65

Browse files
committed
In accordance to
http://www.pgsql.ru/db/mw/msg.html?mid=2045361change TimeATD to/from Datum macros.Re-initdb is needed.
1 parent33b92a7 commit5553d65

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
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-2005, 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.253 2004/12/31 22:03:24 pgsql Exp $
40+
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.254 2005/02/25 16:13:29 teodor Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200411041
56+
#defineCATALOG_VERSION_NO200502251
5757

5858
#endif

‎src/include/utils/date.h

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/date.h,v 1.29 2004/12/31 22:03:45 pgsql Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/date.h,v 1.30 2005/02/25 16:13:29 teodor Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -38,18 +38,28 @@ typedef struct
3838
int32zone;/* numeric time zone, in seconds */
3939
}TimeTzADT;
4040

41+
/*
42+
* Macros for fmgr-callable functions.
43+
*
44+
* For TimeADT, we make use of the same support routines as for float8 or int64.
45+
* Therefore TimeADT is pass-by-reference if and only if float8 or int64 is!
46+
*/
4147
#ifdefHAVE_INT64_TIMESTAMP
48+
4249
#defineMAX_TIME_PRECISION 6
50+
51+
#defineDatumGetDateADT(X) ((DateADT) DatumGetInt32(X))
52+
#defineDatumGetTimeADT(X) ((TimeADT) DatumGetInt64(X))
53+
#defineDatumGetTimeTzADTP(X) ((TimeTzADT *) DatumGetPointer(X))
54+
55+
#defineDateADTGetDatum(X) Int32GetDatum(X)
56+
#defineTimeADTGetDatum(X) Int64GetDatum(X)
57+
#defineTimeTzADTPGetDatum(X) PointerGetDatum(X)
58+
4359
#else
60+
4461
#defineMAX_TIME_PRECISION 10
45-
#endif
4662

47-
/*
48-
* Macros for fmgr-callable functions.
49-
*
50-
* For TimeADT, we make use of the same support routines as for float8.
51-
* Therefore TimeADT is pass-by-reference if and only if float8 is!
52-
*/
5363
#defineDatumGetDateADT(X) ((DateADT) DatumGetInt32(X))
5464
#defineDatumGetTimeADT(X) ((TimeADT) DatumGetFloat8(X))
5565
#defineDatumGetTimeTzADTP(X) ((TimeTzADT *) DatumGetPointer(X))
@@ -58,6 +68,8 @@ typedef struct
5868
#defineTimeADTGetDatum(X) Float8GetDatum(X)
5969
#defineTimeTzADTPGetDatum(X) PointerGetDatum(X)
6070

71+
#endif/* HAVE_INT64_TIMESTAMP */
72+
6173
#definePG_GETARG_DATEADT(n) DatumGetDateADT(PG_GETARG_DATUM(n))
6274
#definePG_GETARG_TIMEADT(n) DatumGetTimeADT(PG_GETARG_DATUM(n))
6375
#definePG_GETARG_TIMETZADT_P(n) DatumGetTimeTzADTP(PG_GETARG_DATUM(n))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp