Lists: | pgsql-patches |
---|
From: | Sean Chittenden <chitt(at)speakeasy(dot)net> |
---|---|
To: | PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Quieting the copyright/startup message... |
Date: | 2004-10-04 07:33:43 |
Message-ID: | B805CD2D-15D7-11D9-BF5A-000A95C705DC@speakeasy.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-patches |
After seeing the "Welcome to psql 8.0.0beta3, the PostgreSQL
interactive terminal." message, I finally got irritated enough at it to
try and figure out how to silence it without using the -q option to
psql(1). The attached (trivial) patch fixes said problem so that one
can add "\set QUIET" to their ~/.psqlrc and have psql not print out
their favorite database shell greeting.
This patch, while a feature (albeit minor), is low risk and I'd love to
see it added to 8.X. :) -sc
echo '\set QUIET' >> ~/.psqlrc
% cat ~/.psqlrc
\timing
\set QUIET
% psql foo
foo=#
Attachment | Content-Type | Size |
---|---|---|
patch.txt | text/plain | 1.4 KB |
From: | Neil Conway <neilc(at)samurai(dot)com> |
---|---|
To: | Sean Chittenden <chitt(at)speakeasy(dot)net> |
Cc: | PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Quieting the copyright/startup message... |
Date: | 2004-10-05 00:32:00 |
Message-ID: | 1096936320.9148.18.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-patches |
On Mon, 2004-10-04 at 17:33, Sean Chittenden wrote:
> After seeing the "Welcome to psql 8.0.0beta3, the PostgreSQL
> interactive terminal." message, I finally got irritated enough at it to
> try and figure out how to silence it without using the -q option to
> psql(1).
I think the second hunk (arranging to read ~/.psqlrc before emitting the
copyright message) is all that's necessary:
[neilc:/home/neilc/pgsql]% cvs diff
Index: src/bin/psql/startup.c
===================================================================
RCS file:
/home/neilc/private-cvsroot/pgsql-server/src/bin/psql/startup.c,v
retrieving revision 1.101
diff -c -r1.101 startup.c
*** src/bin/psql/startup.c 27 Sep 2004 19:16:02 -0000 1.101
--- src/bin/psql/startup.c 5 Oct 2004 00:29:47 -0000
***************
*** 280,285 ****
--- 280,288 ----
*/
else
{
+ if (!options.no_psqlrc)
+ process_psqlrc(argv[0]);
+
if (!QUIET() && !pset.notty)
{
printf(gettext("Welcome to %s %s, the PostgreSQL
interactive terminal.\n\n"
***************
*** 302,309 ****
SetVariable(pset.vars, "PROMPT2", DEFAULT_PROMPT2);
SetVariable(pset.vars, "PROMPT3", DEFAULT_PROMPT3);
- if (!options.no_psqlrc)
- process_psqlrc(argv[0]);
if (!pset.notty)
initializeInput(options.no_readline ? 0 : 1);
if (options.action_string) /* -f - was used
*/
--- 305,310 ----
[neilc:/home/neilc/pgsql]% cat ~/.psqlrc
\set QUIET on
[neilc:/home/neilc/pgsql]% psql
neilc=#
I'll apply the second hunk to CVS later today.
-Neil
From: | Neil Conway <neilc(at)samurai(dot)com> |
---|---|
To: | Sean Chittenden <chitt(at)speakeasy(dot)net> |
Cc: | PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Quieting the copyright/startup message... |
Date: | 2004-10-06 08:22:07 |
Message-ID: | 1097050927.13119.91.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-patches |
On Tue, 2004-10-05 at 10:32, Neil Conway wrote:
> I think the second hunk (arranging to read ~/.psqlrc before emitting the
> copyright message) is all that's necessary [...]
Patch applied.
-Neil