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
7f0b6903
Commit
7f0b6903
authored
Jul 12, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve comments for AdjustIntervalForTypmod.
Blank line adjustments.
parent
62abb039
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
25 deletions
+14
-25
src/backend/utils/adt/nabstime.c
src/backend/utils/adt/nabstime.c
+1
-2
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+2
-2
src/backend/utils/adt/timestamp.c
src/backend/utils/adt/timestamp.c
+6
-11
src/interfaces/ecpg/pgtypeslib/dt_common.c
src/interfaces/ecpg/pgtypeslib/dt_common.c
+0
-1
src/interfaces/ecpg/pgtypeslib/interval.c
src/interfaces/ecpg/pgtypeslib/interval.c
+4
-5
src/interfaces/ecpg/pgtypeslib/timestamp.c
src/interfaces/ecpg/pgtypeslib/timestamp.c
+1
-4
No files found.
src/backend/utils/adt/nabstime.c
View file @
7f0b6903
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.13
4 2005/06/29 22:51:56 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.13
5 2005/07/12 16:04:56 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -833,7 +833,6 @@ interval_reltime(PG_FUNCTION_ARGS)
#ifdef HAVE_INT64_TIMESTAMP
int64
span
;
#else
double
span
;
#endif
...
...
src/backend/utils/adt/selfuncs.c
View file @
7f0b6903
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.18
3 2005/06/29 22:51:56 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.18
4 2005/07/12 16:04:57 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2802,7 +2802,7 @@ convert_timevalue_to_scalar(Datum value, Oid typid)
#ifdef HAVE_INT64_TIMESTAMP
if
(
interval
->
status
!=
0
)
return
((
interval
->
data
[
1
]
-
interval
->
data
[
0
])
*
1000000
.
0
);
return
((
interval
->
data
[
1
]
-
interval
->
data
[
0
])
*
1000000
.
0
);
#else
if
(
interval
->
status
!=
0
)
return
interval
->
data
[
1
]
-
interval
->
data
[
0
];
...
...
src/backend/utils/adt/timestamp.c
View file @
7f0b6903
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.13
1 2005/07/12 15:17:44
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.13
2 2005/07/12 16:04:58
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -47,7 +47,6 @@ TimestampTz PgStartTime;
#ifdef HAVE_INT64_TIMESTAMP
static
int64
time2t
(
const
int
hour
,
const
int
min
,
const
int
sec
,
const
fsec_t
fsec
);
#else
static
double
time2t
(
const
int
hour
,
const
int
min
,
const
int
sec
,
const
fsec_t
fsec
);
#endif
...
...
@@ -642,7 +641,10 @@ interval_scale(PG_FUNCTION_ARGS)
PG_RETURN_INTERVAL_P
(
result
);
}
/*
* Adjust interval for specified precision, in both YEAR to SECOND
* range and sub-second precision.
*/
static
void
AdjustIntervalForTypmod
(
Interval
*
interval
,
int32
typmod
)
{
...
...
@@ -722,7 +724,6 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
{
#ifdef HAVE_INT64_TIMESTAMP
int64
day
;
#else
double
day
;
#endif
...
...
@@ -744,7 +745,6 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
{
#ifdef HAVE_INT64_TIMESTAMP
int64
hour
;
#else
double
hour
;
#endif
...
...
@@ -887,7 +887,7 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
else
elog
(
ERROR
,
"unrecognized interval typmod: %d"
,
typmod
);
/* Need to adjust
precision? If not, don't even try!
*/
/* Need to adjust
subsecond precision?
*/
if
(
precision
!=
INTERVAL_FULL_PRECISION
)
{
if
(
precision
<
0
||
precision
>
MAX_INTERVAL_PRECISION
)
...
...
@@ -990,7 +990,6 @@ dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec)
{
#ifdef HAVE_INT64_TIMESTAMP
int64
time
;
#else
double
time
;
#endif
...
...
@@ -1171,7 +1170,6 @@ tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *result)
#ifdef HAVE_INT64_TIMESTAMP
int
date
;
int64
time
;
#else
double
date
,
time
;
...
...
@@ -1211,7 +1209,6 @@ interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec)
{
#ifdef HAVE_INT64_TIMESTAMP
int64
time
;
#else
double
time
;
#endif
...
...
@@ -1648,7 +1645,6 @@ interval_cmp_internal(Interval *interval1, Interval *interval2)
#ifdef HAVE_INT64_TIMESTAMP
int64
span1
,
span2
;
#else
double
span1
,
span2
;
...
...
@@ -2192,7 +2188,6 @@ interval_mul(PG_FUNCTION_ARGS)
#ifdef HAVE_INT64_TIMESTAMP
int64
months
;
#else
double
months
;
#endif
...
...
src/interfaces/ecpg/pgtypeslib/dt_common.c
View file @
7f0b6903
...
...
@@ -1237,7 +1237,6 @@ dt2time(double jd, int *hour, int *min, int *sec, fsec_t *fsec)
{
#ifdef HAVE_INT64_TIMESTAMP
int64
time
;
#else
double
time
;
#endif
...
...
src/interfaces/ecpg/pgtypeslib/interval.c
View file @
7f0b6903
...
...
@@ -416,7 +416,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fse
sec
=
(
*
fsec
/
USECS_PER_SEC
);
*
fsec
-=
(
sec
*
USECS_PER_SEC
);
#else
TMODULO
(
*
fsec
,
sec
,
1
e
0
);
TMODULO
(
*
fsec
,
sec
,
1
.
0
);
#endif
tm
->
tm_sec
+=
sec
;
}
...
...
@@ -674,7 +674,6 @@ interval2tm(interval span, struct tm * tm, fsec_t *fsec)
{
#ifdef HAVE_INT64_TIMESTAMP
int64
time
;
#else
double
time
;
#endif
...
...
@@ -704,9 +703,9 @@ interval2tm(interval span, struct tm * tm, fsec_t *fsec)
*
fsec
=
(
time
-
(
tm
->
tm_sec
*
USECS_PER_SEC
));
#else
TMODULO
(
time
,
tm
->
tm_mday
,
(
double
)
SECS_PER_DAY
);
TMODULO
(
time
,
tm
->
tm_hour
,
3600
e
0
);
TMODULO
(
time
,
tm
->
tm_min
,
60
e
0
);
TMODULO
(
time
,
tm
->
tm_sec
,
1
e
0
);
TMODULO
(
time
,
tm
->
tm_hour
,
3600
.
0
);
TMODULO
(
time
,
tm
->
tm_min
,
60
.
0
);
TMODULO
(
time
,
tm
->
tm_sec
,
1
.
0
);
*
fsec
=
time
;
#endif
...
...
src/interfaces/ecpg/pgtypeslib/timestamp.c
View file @
7f0b6903
...
...
@@ -103,7 +103,6 @@ dt2time(timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec)
{
#ifdef HAVE_INT64_TIMESTAMP
int64
time
;
#else
double
time
;
#endif
...
...
@@ -148,7 +147,6 @@ timestamp2tm(timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn)
int
dDate
,
date0
;
int64
time
;
#else
double
dDate
,
date0
;
...
...
@@ -280,7 +278,6 @@ PGTYPEStimestamp_from_asc(char *str, char **endptr)
#ifdef HAVE_INT64_TIMESTAMP
int64
noresult
=
0
;
#else
double
noresult
=
0
.
0
;
#endif
...
...
@@ -572,7 +569,7 @@ dttofmtasc_replace(timestamp *ts, date dDate, int dow, struct tm * tm,
break
;
case
's'
:
#ifdef HAVE_INT64_TIMESTAMP
replace_val
.
int64_val
=
(
*
ts
-
SetEpochTimestamp
())
/
1000000
e
0
;
replace_val
.
int64_val
=
(
*
ts
-
SetEpochTimestamp
())
/
1000000
.
0
;
replace_type
=
PGTYPES_TYPE_INT64
;
#else
replace_val
.
double_val
=
*
ts
-
SetEpochTimestamp
();
...
...
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