Skip to content

age() function in postgres not working as expected #425

@StanBright

Description

@StanBright

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 the age() 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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions