Skip to content

Slave lag query returning NaN #105

Open
@keithf4

Description

@keithf4

The following query keeps returning NaN

SELECT extract(epoch from now() - pg_last_xact_replay_timestamp())::int AS last_replay_time

I'm able to run this query as a non-superuser in the database and get results back, but I checked using a security definer function and it returns NaN as well

CREATE OR REPLACE FUNCTION monitor.replica_replay_time_lag() RETURNS TABLE (last_replay_time int) 
    LANGUAGE SQL SECURITY DEFINER
AS $$
    SELECT extract(epoch from now() - pg_last_xact_replay_timestamp())::int AS last_replay_time
    $$;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions