From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Ian Lawrence Barwick <barwick(at)gmail(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: 9.3 release notes suggestions |
Date: | 2013-05-04 17:23:25 |
Message-ID: | 20130504172325.GJ5631@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sat, May 4, 2013 at 01:17:44PM -0400, Bruce Momjian wrote:
> Yes, I see it is wrong now. I came up with this new query:
>
> SELECT to_hex(EXTRACT(EPOCH FROM backend_start)::integer) || '.' ||
> regexp_replace('0000' || to_hex(pid), '^0*(.*....)$', '\1')
> FROM pg_stat_activity;
>
> It removes some leading zeros, but guarantees 4 digits.
>
> I have updated to that new query to our docs too. Is there a better
> regex for this?
OK, I thought of a better one:
SELECT to_hex(EXTRACT(EPOCH FROM backend_start)::integer) || '.' ||
regexp_replace('0000' || '0133e3', '^0*(.{4,})$', '\1')
FROM pg_stat_activity;
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2013-05-04 17:29:09 | Re: Remaining beta blockers |
Previous Message | Bruce Momjian | 2013-05-04 17:17:44 | Re: 9.3 release notes suggestions |