From 8be9bd83acd43762cf0dc8a45229a693896e7755 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 10 Aug 2002 19:35:01 +0000 Subject: [PATCH] psql prints its version number in its startup message, per recent discussion. Also, cause the \timing command to display time in a format consistent with the backend's EXPLAIN ANALYZE output. --- doc/src/sgml/manage.sgml | 4 ++-- doc/src/sgml/ref/psql-ref.sgml | 6 +++--- doc/src/sgml/start.sgml | 4 ++-- src/bin/psql/common.c | 5 +++-- src/bin/psql/help.c | 5 +++-- src/bin/psql/startup.c | 6 +++--- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/doc/src/sgml/manage.sgml b/doc/src/sgml/manage.sgml index 43dd8d5a95..786adb7196 100644 --- a/doc/src/sgml/manage.sgml +++ b/doc/src/sgml/manage.sgml @@ -1,5 +1,5 @@ @@ -130,7 +130,7 @@ to try out the examples in this manual. You will be greeted with the following message: -Welcome to psql, the PostgreSQL interactive terminal. +Welcome to psql &version;, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 48370d1e21..4ddc70d212 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1,5 +1,5 @@ @@ -488,7 +488,7 @@ PostgreSQL documentation the string =>. For example, $ psql testdb -Welcome to psql, the PostgreSQL interactive terminal. +Welcome to psql &version;, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands @@ -1582,7 +1582,7 @@ lo_import 152801 \timing - Toggles a display of how long each query takes in seconds. + Toggles a display of how long each query takes, in milliseconds. diff --git a/doc/src/sgml/start.sgml b/doc/src/sgml/start.sgml index 439f65e98f..a1adb712ce 100644 --- a/doc/src/sgml/start.sgml +++ b/doc/src/sgml/start.sgml @@ -1,5 +1,5 @@ @@ -313,7 +313,7 @@ createdb: database creation failed In psql, you will be greeted with the following message: -Welcome to psql, the PostgreSQL interactive terminal. +Welcome to psql &version;, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index 1b1e462660..9362886c4c 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.41 2002/07/06 20:12:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.42 2002/08/10 19:35:00 tgl Exp $ */ #include "postgres_fe.h" @@ -466,7 +466,8 @@ SendQuery(const char *query) /* Possible microtiming output */ if (pset.timing && success) - printf(gettext("Total time: %.3fs\n"), ((after.tv_sec-before.tv_sec)*1000000 + after.tv_usec - before.tv_usec) / 1000000.0); + printf(gettext("Total time: %.2f msec\n"), + ((after.tv_sec-before.tv_sec)*1000000 + after.tv_usec - before.tv_usec) / 1000.0); return success; } diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index 02d7603975..4e00c5e7d1 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.53 2002/08/10 16:57:32 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.54 2002/08/10 19:35:01 tgl Exp $ */ #include "postgres_fe.h" #include "print.h" @@ -80,7 +80,8 @@ usage(void) } /* If this " is the start of the string then it ought to end there to fit in 80 columns >> " */ - puts(_("This is psql, the PostgreSQL interactive terminal.\n")); + printf(_("This is psql %s, the PostgreSQL interactive terminal.\n"), + PG_VERSION); puts(_("Usage:")); puts(_(" psql [options] [dbname [username]]\n")); puts(_("Options:")); diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 5f6447c79f..ed734ec5a1 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.61 2002/07/15 22:48:54 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.62 2002/08/10 19:35:01 tgl Exp $ */ #include "postgres_fe.h" @@ -281,13 +281,13 @@ main(int argc, char *argv[]) pset.issuper = test_superuser(PQuser(pset.db)); if (!QUIET() && !pset.notty) { - printf(gettext("Welcome to %s, the PostgreSQL interactive terminal.\n\n" + printf(gettext("Welcome to %s %s, the PostgreSQL interactive terminal.\n\n" "Type: \\copyright for distribution terms\n" " \\h for help with SQL commands\n" " \\? for help on internal slash commands\n" " \\g or terminate with semicolon to execute query\n" " \\q to quit\n\n"), - pset.progname); + pset.progname, PG_VERSION); #ifdef USE_SSL printSSLInfo(); #endif