Re: uptime function to postmaster

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Euler Taveira de Oliveira <eulerto(at)yahoo(dot)com(dot)br>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: uptime function to postmaster
Date: 2005-06-06 17:54:25
Message-ID: 200506061754.j56HsPT24008@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Euler Taveira de Oliveira wrote:
> Hi Bruce,
>
> >
> > I think we are best with just pg_startime. If people want the
> > interval
> > they can subtract it from CURRENT_TIMESTAMP. I have added Matthias's
> > version to the patch queue.
> >
> >
> OK. But IIRC the Matthias implementation doesn't work in standalone
> mode. And talking about the 'interval', I think it's too ugly make
> this:
> select CURRENT_TIMESTAMP - pg_starttime();
>
> Isn't it more simple do this?
> select pg_uptime();

I think we should return intervals only when we can't return meaningful
timestamp values. I don't have any logic to back up that opinion, though.

>
> I think few people will use start_time and more people will use uptime
> that's why I propose the 'uptime' function.

We need to preceed our function names with pg_ for cases like this where
we are supplying pg-specific behavior.

> Talking abouts names, IMHO we need to go with uptime() and
> start_time(). Why? That's because a system function and it's about
> server. When we implement backend uptime, we can go with
> connection_uptime() and connection_start_time().

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-06-06 17:59:59 Re: uptime function to postmaster
Previous Message Bruce Momjian 2005-06-06 17:49:54 Re: regexp_replace