Re: WIP: psql default banner patch v4

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: psql default banner patch v4
Date: 2008-04-23 21:44:43
Message-ID: 20080423214442.GL6572@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joshua D. Drake wrote:

> ! puts(_("\n"));
> ! puts(_("You are using psql, the command-line interface to PostgreSQL.\n"));
> ! puts(_("\tFor SQL help type \\h or \\help ."));
^ here
> ! puts(_("\tFor help using psql type \\? ."));
^ here
> ! puts(_("\tTo quit psql type \\q .\n"));
^ here
> ! puts(_("\tTo view the copyright type \\copyright .\n"));
^ here

> Index: prompt.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/bin/psql/prompt.c,v
> retrieving revision 1.51
> diff -c -r1.51 prompt.c
> *** prompt.c 1 Jan 2008 19:45:56 -0000 1.51
> --- prompt.c 23 Apr 2008 21:32:20 -0000
> ***************
> *** 158,164 ****
> /* DB server user name */
> case 'n':
> if (pset.db)
> ! strlcpy(buf, session_username(), sizeof(buf));
> break;
>
> case '0':
> --- 158,164 ----
> /* DB server user name */
> case 'n':
> if (pset.db)
> ! strlcpy(buf, session_username(), sizeof(buf));
> break;
>
> case '0':

Please remove this hunk. (In general make sure there are no useless
hunks in the diff.)

> if (pset.sversion / 100 != client_ver / 100)
> ! printf(_("\tWARNING: Server version %d.%d, %s version %d.%d.\n\tSome psql features may not work.\n\n"),

Minor suggestion: it looks better this way (the end effect is the same):

printf(_("\tWARNING: Server version %d.%d, %s version %d.%d.\n"
"\tSome psql features may not work.\n\n"),

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2008-04-23 21:49:09 Re: WIP: psql default banner patch v4
Previous Message Joshua D. Drake 2008-04-23 21:32:44 Re: WIP: psql default banner patch v4