Skip to content

added decimal point truncate to postmaster start time query #865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

tschuyebuhl
Copy link

@tschuyebuhl tschuyebuhl commented Jul 7, 2023

postgres=# SELECT CAST(extract(epoch from pg_postmaster_start_time()) AS INTEGER) as start_time;
 start_time 
------------
 1667939963
(1 row)

postgres=# SELECT extract(epoch from pg_postmaster_start_time()) as start_time;
    start_time     
-------------------
 1667939963.007028
(1 row)

the current query results in this error spam:

ts=2023-07-07T15:35:20.847Z caller=collector.go:190 level=error msg="collector failed" name=postmaster duration_seconds=0.016613707 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2022-11-08 21:39:23.007028 +0100 CET\") to a float64: invalid syntax"
we probably dont need to use float64 with this change, but i didn't want to make a bigger mess for now
issue ref: #850

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Signed-off-by: pyoxa <ksawerywr@gmail.com>
@sysadmind
Copy link
Contributor

I just checked locally, this has already been resolved in the master branch. v0.13.1 still has this bug. The error you see was resolved in #828

Also of note, we have opened #830 to track improvements to this collector.

@tschuyebuhl
Copy link
Author

Right. We can close this one. I just double checked now and, of course, you are right:
image
Thank you for your time anyways. Waiting til #828 makes its way downstream.

@SuperQ SuperQ closed this Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants