Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7a877dfd
Commit
7a877dfd
authored
Jan 02, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove DATEDEBUG because it didn't look Y2K safe, and fix timestamp elog
to be Y2K safe.
parent
eb9bb3de
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
386 deletions
+7
-386
src/backend/utils/adt/date.c
src/backend/utils/adt/date.c
+1
-10
src/backend/utils/adt/datetime.c
src/backend/utils/adt/datetime.c
+1
-37
src/backend/utils/adt/dt.c
src/backend/utils/adt/dt.c
+2
-315
src/backend/utils/adt/nabstime.c
src/backend/utils/adt/nabstime.c
+1
-22
src/backend/utils/misc/trace.c
src/backend/utils/misc/trace.c
+2
-2
No files found.
src/backend/utils/adt/date.c
View file @
7a877dfd
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.3
8 1999/09/21 20:58:25
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.3
9 2000/01/02 01:37:26
momjian Exp $
*
* NOTES
* This code is actually (almost) unused.
...
...
@@ -142,10 +142,6 @@ reltimein(char *str)
||
(
DecodeDateDelta
(
field
,
ftype
,
nf
,
&
dtype
,
tm
,
&
fsec
)
!=
0
))
elog
(
ERROR
,
"Bad reltime external representation '%s'"
,
str
);
#ifdef DATEDEBUG
printf
(
"reltimein- %d fields are type %d (DTK_DATE=%d)
\n
"
,
nf
,
dtype
,
DTK_DATE
);
#endif
switch
(
dtype
)
{
case
DTK_DELTA
:
...
...
@@ -351,11 +347,6 @@ timespan_reltime(TimeSpan *timespan)
span
=
(((((
double
)
365
*
year
)
+
((
double
)
30
*
month
))
*
86400
)
+
timespan
->
time
);
#ifdef DATEDEBUG
printf
(
"timespan_reltime- convert m%d s%f to %f [%d %d]
\n
"
,
timespan
->
month
,
timespan
->
time
,
span
,
INT_MIN
,
INT_MAX
);
#endif
time
=
(((
span
>
INT_MIN
)
&&
(
span
<
INT_MAX
))
?
span
:
INVALID_RELTIME
);
}
...
...
src/backend/utils/adt/datetime.c
View file @
7a877dfd
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.3
8 1999/07/17 20:17:55
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.3
9 2000/01/02 01:37:26
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -48,9 +48,6 @@ date_in(char *str)
if
(
!
PointerIsValid
(
str
))
elog
(
ERROR
,
"Bad (null) date external representation"
,
NULL
);
#ifdef DATEDEBUG
printf
(
"date_in- input string is %s
\n
"
,
str
);
#endif
if
((
ParseDateTime
(
str
,
lowstr
,
field
,
ftype
,
MAXDATEFIELDS
,
&
nf
)
!=
0
)
||
(
DecodeDateTime
(
field
,
ftype
,
nf
,
&
dtype
,
tm
,
&
fsec
,
&
tzp
)
!=
0
))
elog
(
ERROR
,
"Bad date external representation '%s'"
,
str
);
...
...
@@ -204,11 +201,6 @@ date_datetime(DateADT dateVal)
if
(
date2tm
(
dateVal
,
&
tz
,
tm
,
&
fsec
,
&
tzn
)
!=
0
)
elog
(
ERROR
,
"Unable to convert date to datetime"
,
NULL
);
#ifdef DATEDEBUG
printf
(
"date_datetime- date is %d.%02d.%02d
\n
"
,
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
);
printf
(
"date_datetime- time is %02d:%02d:%02d %.7f
\n
"
,
tm
->
tm_hour
,
tm
->
tm_min
,
tm
->
tm_sec
,
fsec
);
#endif
if
(
tm2datetime
(
tm
,
fsec
,
&
tz
,
result
)
!=
0
)
elog
(
ERROR
,
"Datetime out of range"
,
NULL
);
...
...
@@ -330,17 +322,6 @@ date2tm(DateADT dateVal, int *tzp, struct tm * tm, double *fsec, char **tzn)
#ifdef USE_POSIX_TIME
tx
=
localtime
(
&
utime
);
#ifdef DATEDEBUG
#if defined(HAVE_TM_ZONE)
printf
(
"date2tm- (localtime) %d.%02d.%02d %02d:%02d:%02.0f %s dst=%d
\n
"
,
tx
->
tm_year
,
tx
->
tm_mon
,
tx
->
tm_mday
,
tx
->
tm_hour
,
tx
->
tm_min
,
(
double
)
tm
->
tm_sec
,
tx
->
tm_zone
,
tx
->
tm_isdst
);
#elif defined(HAVE_INT_TIMEZONE)
printf
(
"date2tm- (localtime) %d.%02d.%02d %02d:%02d:%02.0f %s %s dst=%d
\n
"
,
tx
->
tm_year
,
tx
->
tm_mon
,
tx
->
tm_mday
,
tx
->
tm_hour
,
tx
->
tm_min
,
(
double
)
tm
->
tm_sec
,
tzname
[
0
],
tzname
[
1
],
tx
->
tm_isdst
);
#endif
#endif
tm
->
tm_year
=
tx
->
tm_year
+
1900
;
tm
->
tm_mon
=
tx
->
tm_mon
+
1
;
tm
->
tm_mday
=
tx
->
tm_mday
;
...
...
@@ -375,29 +356,12 @@ date2tm(DateADT dateVal, int *tzp, struct tm * tm, double *fsec, char **tzn)
}
else
{
#ifdef DATEDEBUG
printf
(
"date2tm- convert %d-%d-%d %d:%d%d to datetime
\n
"
,
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
,
tm
->
tm_hour
,
tm
->
tm_min
,
tm
->
tm_sec
);
#endif
*
tzp
=
0
;
tm
->
tm_isdst
=
0
;
if
(
tzn
!=
NULL
)
*
tzn
=
NULL
;
}
#ifdef DATEDEBUG
#if defined(HAVE_TM_ZONE)
printf
(
"date2tm- %d.%02d.%02d %02d:%02d:%02.0f (%d %s) dst=%d
\n
"
,
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
,
tm
->
tm_hour
,
tm
->
tm_min
,
(
double
)
tm
->
tm_sec
,
*
tzp
,
tm
->
tm_zone
,
tm
->
tm_isdst
);
#elif defined(HAVE_INT_TIMEZONE)
printf
(
"date2tm- %d.%02d.%02d %02d:%02d:%02.0f (%d %s %s) dst=%d
\n
"
,
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
,
tm
->
tm_hour
,
tm
->
tm_min
,
(
double
)
tm
->
tm_sec
,
*
tzp
,
tzname
[
0
],
tzname
[
1
],
tm
->
tm_isdst
);
#endif
#endif
return
0
;
}
/* date2tm() */
...
...
src/backend/utils/adt/dt.c
View file @
7a877dfd
This diff is collapsed.
Click to expand it.
src/backend/utils/adt/nabstime.c
View file @
7a877dfd
...
...
@@ -4,7 +4,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: nabstime.c,v 1.6
2 1999/12/09 05:02:24
momjian Exp $
* $Id: nabstime.c,v 1.6
3 2000/01/02 01:37:27
momjian Exp $
*
*/
#include <ctype.h>
...
...
@@ -103,11 +103,6 @@ GetCurrentAbsoluteTime(void)
#endif
};
#ifdef DATEDEBUG
printf
(
"GetCurrentAbsoluteTime- timezone is %s -> %d seconds from UTC
\n
"
,
CTZName
,
CTimeZone
);
#endif
return
(
AbsoluteTime
)
now
;
}
/* GetCurrentAbsoluteTime() */
...
...
@@ -144,18 +139,6 @@ abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn)
};
#endif
#if defined(DATEDEBUG)
#if defined(HAVE_TM_ZONE)
printf
(
"datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02d %s dst=%d
\n
"
,
tx
->
tm_year
,
tx
->
tm_mon
,
tx
->
tm_mday
,
tx
->
tm_hour
,
tx
->
tm_min
,
tx
->
tm_sec
,
tx
->
tm_zone
,
tx
->
tm_isdst
);
#elif defined(HAVE_INT_TIMEZONE)
printf
(
"datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02d %s %s dst=%d
\n
"
,
tx
->
tm_year
,
tx
->
tm_mon
,
tx
->
tm_mday
,
tx
->
tm_hour
,
tx
->
tm_min
,
tx
->
tm_sec
,
tzname
[
0
],
tzname
[
1
],
tx
->
tm_isdst
);
#endif
#endif
#ifdef USE_POSIX_TIME
tm
->
tm_year
=
tx
->
tm_year
+
1900
;
...
...
@@ -291,10 +274,6 @@ nabstimein(char *str)
||
(
DecodeDateTime
(
field
,
ftype
,
nf
,
&
dtype
,
tm
,
&
fsec
,
&
tz
)
!=
0
))
elog
(
ERROR
,
"Bad abstime external representation '%s'"
,
str
);
#ifdef DATEDEBUG
printf
(
"nabstimein- %d fields are type %d (DTK_DATE=%d)
\n
"
,
nf
,
dtype
,
DTK_DATE
);
#endif
switch
(
dtype
)
{
case
DTK_DATE
:
...
...
src/backend/utils/misc/trace.c
View file @
7a877dfd
...
...
@@ -233,8 +233,8 @@ tprintf_timestamp()
time
=
localtime
(
&
tm
);
sprintf
(
pid
,
"[%d]"
,
MyProcPid
);
sprintf
(
timestamp
,
"%0
2
d%02d%02d.%02d:%02d:%02d.%03d %7s "
,
time
->
tm_year
,
time
->
tm_mon
+
1
,
time
->
tm_mday
,
sprintf
(
timestamp
,
"%0
4
d%02d%02d.%02d:%02d:%02d.%03d %7s "
,
time
->
tm_year
+
1900
,
time
->
tm_mon
+
1
,
time
->
tm_mday
,
time
->
tm_hour
,
time
->
tm_min
,
time
->
tm_sec
,
(
int
)
(
tv
.
tv_usec
/
1000
),
pid
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment