aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/nabstime.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-03-21 01:31:43 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-03-21 01:31:43 +0000
commit2d0583a166402cbed19ba2b85b6c0b9240cff563 (patch)
tree07a7fd1030484b54fc027c9c66db87c545ab08ac /src/backend/utils/adt/nabstime.c
parent6b0706ac33ab5da815980c642a9cde9a4cd86b6b (diff)
downloadpostgresql-2d0583a166402cbed19ba2b85b6c0b9240cff563.tar.gz
postgresql-2d0583a166402cbed19ba2b85b6c0b9240cff563.zip
Get rid of a bunch of #ifdef HAVE_INT64_TIMESTAMP conditionals by inventing
a new typedef TimeOffset to represent an intermediate time value. It's either int64 or double as appropriate, and in most usages will be measured in microseconds or seconds the same as Timestamp. We don't call it Timestamp, though, since the value doesn't necessarily represent an absolute time instant. Warren Turkal
Diffstat (limited to 'src/backend/utils/adt/nabstime.c')
-rw-r--r--src/backend/utils/adt/nabstime.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index 2265b7d903e..c1a484d9bb6 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.153 2008/02/17 02:09:28 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.154 2008/03/21 01:31:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -831,12 +831,7 @@ interval_reltime(PG_FUNCTION_ARGS)
int year,
month,
day;
-
-#ifdef HAVE_INT64_TIMESTAMP
- int64 span;
-#else
- double span;
-#endif
+ TimeOffset span;
year = interval->month / MONTHS_PER_YEAR;
month = interval->month % MONTHS_PER_YEAR;