Time measurement format - more human readable - Mailing list pgsql-hackers

From Bogdan Pilch
Subject Time measurement format - more human readable
Date
Msg-id 20140928114951.GB22150@artax.karlin.mff.cuni.cz
Whole thread Raw
Responses Re: Time measurement format - more human readable  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Re: Time measurement format - more human readable  (Gregory Smith <gregsmithpgsql@gmail.com>)
List pgsql-hackers
Hi,
I have created a small patch to postgres source (in particular the
psql part of it) that modifies the way time spent executing the SQL
commands is printed out.

The idea is to have a human readable time printed, e.g.:
Time: 1:32:15.45 m:s:ms
Time: 2_10:12:55:444.033 d_h:m:s:ms

Attached you can find a patch without any regression tests for that as
this is practically impossible to test with regression tests. The
duration of an SQL command (even though using pg_sleep) would differ
on each machine and even between consecutive runs. Therefore one
cannot specify a static expected output.
My patch is relative to origin/REL9_4_STABLE branch as that is the one
I started from.

My plea is to have this change merged into the main stream so that it
becomes available in upcoming releases.

This modification does not require any interaction with user.
It may create backward compatibility issues if some SQL developers
assumed that the format is always <milis>.<micros>.

regards
bogdan


Attachment

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: json (b) and null fields
Next
From: Bogdan Pilch
Date:
Subject: Tab expansion - on/off feature