\timing on/off

Started by Heikki Linnakangasabout 18 years ago4 messagespatches
Jump to latest
#1Heikki Linnakangas
heikki.linnakangas@enterprisedb.com

I started to look at David Fetter's patch to enable "\timing on/off", in
addition to toggling the mod with just "\timing".

I gather that the conclusion of the thread "Making sure \timing is on",
starting at:
http://archives.postgresql.org/pgsql-general/2008-05/msg00324.php

was that we should leave \H and \a alone for now, because it's not clear
what "\H off" would do. And \a is already documented as deprecated; we
might want to do that for \H as well.

Here's a patch, based on David's patch, that turns timing into a \pset
variable, and makes \timing an alias for \pset timing. This makes
\timing behave the same as \x.

I also moved the help line from the "External" section into
"Formatting". I don't think \timing is "external" in the same sense as
\cd or \! are. Rather, it controls the output, like \x or \pset options.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Heikki Linnakangas (#1)
Re: \timing on/off

And here is the patch I forgot to attach.

Heikki Linnakangas wrote:

I started to look at David Fetter's patch to enable "\timing on/off", in
addition to toggling the mod with just "\timing".

I gather that the conclusion of the thread "Making sure \timing is on",
starting at:
http://archives.postgresql.org/pgsql-general/2008-05/msg00324.php

was that we should leave \H and \a alone for now, because it's not clear
what "\H off" would do. And \a is already documented as deprecated; we
might want to do that for \H as well.

Here's a patch, based on David's patch, that turns timing into a \pset
variable, and makes \timing an alias for \pset timing. This makes
\timing behave the same as \x.

I also moved the help line from the "External" section into
"Formatting". I don't think \timing is "external" in the same sense as
\cd or \! are. Rather, it controls the output, like \x or \pset options.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachments:

timing-onoff-1.patchtext/x-diff; name=timing-onoff-1.patchDownload+68-45
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Heikki Linnakangas (#2)
Re: \timing on/off

"Heikki Linnakangas" <heikki@enterprisedb.com> writes:

I gather that the conclusion of the thread "Making sure \timing is on",
starting at:
http://archives.postgresql.org/pgsql-general/2008-05/msg00324.php

was that we should leave \H and \a alone for now, because it's not clear
what "\H off" would do.

Yeah, I think that was the consensus.

Here's a patch, based on David's patch, that turns timing into a \pset
variable, and makes \timing an alias for \pset timing. This makes
\timing behave the same as \x.

This seems a bit random to me. AFAIR all of the \pset properties are
associated with formatting of table output. \timing doesn't belong.

regards, tom lane

#4Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Tom Lane (#3)
Re: \timing on/off

Tom Lane wrote:

"Heikki Linnakangas" <heikki@enterprisedb.com> writes:

Here's a patch, based on David's patch, that turns timing into a \pset
variable, and makes \timing an alias for \pset timing. This makes
\timing behave the same as \x.

This seems a bit random to me. AFAIR all of the \pset properties are
associated with formatting of table output. \timing doesn't belong.

Hmm, yes, so it seems. This patch
http://archives.postgresql.org/pgsql-general/2008-05/msg00427.php from
David seems the most appropriate thing to do then.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com