You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, showing the latest users and when they were created:
SELECT username, age(now() at time zone 'utc', created_at)
FROM users
ORDER BY created_at DESC
However, instead of date-time-in-words (e.g. "4 days 5 hours"), Blazer's UI returns/renders a float representing the age in seconds - an interval in Postgres. At the same, if I execute the same query in the DB console directly, I'm getting the expected string.
I'm wondering, is that behaviour expected is a kind of bug/known-issue?
Thanks,
Stan
The text was updated successfully, but these errors were encountered:
Hey @StanBright, thanks for reporting. Postgres use intervalstyle to determine how intervals are displayed. It defaults to postgres, which is probably what you're seeing in the DB console.
It looks like Active Record added support for interval type in 6.1, which changes the style to iso_8601 and parses each value into an ActiveSupport::Duration, which shows the number of seconds when to_s is called.
I agree the current output isn't ideal - will try to spend some time on this in the future.
Hi,
First, thanks for the amazing gem/engine you've built. It's an indispensable part of all my projects. Kudos!
I'm using the latest version of blazer (
2.6.5
as of now), and I'm trying to incorporate theage()
function from Postgres https://www.postgresql.org/docs/current/functions-datetime.html in some of my reports.For example, showing the latest users and when they were created:
However, instead of date-time-in-words (e.g. "4 days 5 hours"), Blazer's UI returns/renders a float representing the age in seconds - an
interval
in Postgres. At the same, if I execute the same query in the DB console directly, I'm getting the expected string.I'm wondering, is that behaviour expected is a kind of bug/known-issue?
Thanks,
Stan
The text was updated successfully, but these errors were encountered: