pg_stat_monitor: Add timezone to bucket_start_time in pg_stat_monitor view.

Description

Timezone in msgtime column in pg_stat_monitor_errors view.

Actual result: 2022-04-28 12:33:00
Expected result: Since I am UTC +2 output should be 2022-04-28 14:33:00

 

Postgres:
PostgreSQL 14.2 (Ubuntu 14.2-1.pgdg20.04+1+b1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit

Timezone in postgres: Europe/Prague

OS: Ubuntu 18.04

Used PGSM branch: dev, since right now its only one, which contains errors view.

How to reproduce:
Please use main or dev branch to reproduce this. Errors view is not merged yet.

1. Set timezone for your postgres different than UTC +0
2. Trigger query which populate errors view.
3. Check column msgtime
4. Compare msgtime to output of query: "SELECT NOW()::TIMESTAMP" in postgres

 

This needs further verification. Is the expected behaviour correct?

 

Environment

None

Smart Checklist

Activity

Show:

Jiří Čtvrtka January 24, 2023 at 1:48 PM

Cool. Thank you guys.

muhammad.usama January 24, 2023 at 12:07 PM

Hamid Akhtar January 16, 2023 at 12:15 PM

This not valid for the error view. However, we need to verify if the bucket start time matches the PG time and timezone at the time of creation.

Hamid Akhtar January 16, 2023 at 12:11 PM

Please coordinate with with regard to the start time. It should match the PG server time.

Hamid Akhtar December 13, 2022 at 12:24 PM

: The requirement isn't clear. Let's have a short call to clarify this issue.

Done

Details

Assignee

Reporter

Fix versions

Priority

Smart Checklist

Created April 28, 2022 at 12:54 PM
Updated March 5, 2024 at 9:27 PM
Resolved February 28, 2023 at 8:40 AM