Skip to content

Commit 3a2687b

Browse files
authored
added decimal point truncate to postmaster start time query
Signed-off-by: pyoxa <[email protected]>
1 parent 4ac5481 commit 3a2687b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collector/pg_postmaster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var (
4444
[]string{}, nil,
4545
)
4646

47-
pgPostmasterQuery = "SELECT extract(epoch from pg_postmaster_start_time) from pg_postmaster_start_time();"
47+
pgPostmasterQuery = "SELECT CAST(extract(epoch from pg_postmaster_start_time()) AS INTEGER) as start_time;" //truncates the decimal part
4848
)
4949

5050
func (c *PGPostmasterCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error {

0 commit comments

Comments
 (0)