Re: implement query_start for pg_stat_activity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: implement query_start for pg_stat_activity
Date: 2003-02-19 06:04:51
Message-ID: 8839.1045634691@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)com> writes:
> (1) The natural name for the backend function is
> pg_stat_get_backend_activity_start(), which at 34 exceeds the
> NAMEDATALEN limitation in previous releases of PostgreSQL. While that
> limit has been raised, it seems a shame to me to not allow users to
> manual lower it again -- so I renamed the function to
> pg_stat_get_backend_qry_start(), and renamed the existing function that
> fetches the query string from pg_stat_get_backend_activity() to
> pg_stat_get_backend_qry() for consistency. If someone thinks that's the
> wrong decision, let me know.

NAMEDATALEN=32 will have been history for two releases when this gets
out. I don't agree with artificially constricting a function name to
conform to an obsolete restriction --- and for *sure* I don't agree with
renaming an existing function to make it line up with a new, artificial
name ...

> (2) I wasn't sure how to convert a struct timeval into a PostgreSQL
> timestamp type, so I hacked something together involving ctime() and
> timestamp_in(), but it seems clearly wrong.

GetCurrentAbsoluteTimeUsec() followed by now() seem to do it at the
moment ... but they do look pretty historically encumbered themselves.
Care to offer a proposal for simplifying this code?

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2003-02-19 06:45:47 Re: implement query_start for pg_stat_activity
Previous Message Neil Conway 2003-02-19 05:27:13 implement query_start for pg_stat_activity