Re: [PATCHES] Quieting the copyright/startup message...

2004-10-06 Thread Neil Conway
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



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


[PATCHES] Quieting the copyright/startup message...

2004-10-04 Thread Sean Chittenden
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=#
Index: command.c
===
RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/command.c,v
retrieving revision 1.125
diff -u -r1.125 command.c
--- command.c   29 Aug 2004 05:06:54 -  1.125
+++ command.c   4 Oct 2004 07:23:41 -
@@ -688,7 +688,9 @@
if (SetVariable(pset.vars, opt0, newval))
{
/* Check for special variables */
-   if (strcmp(opt0, VERBOSITY) == 0)
+   if (strcmp(opt0, QUIET) == 0)
+   SetVariableBool(pset.vars, QUIET);
+   else if (strcmp(opt0, VERBOSITY) == 0)
SyncVerbosityVariable();
}
else
Index: startup.c
===
RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/startup.c,v
retrieving revision 1.101
diff -u -r1.101 startup.c
--- startup.c   27 Sep 2004 19:16:02 -  1.101
+++ startup.c   4 Oct 2004 07:23:42 -
@@ -280,6 +280,9 @@
 */
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,8 +305,6 @@
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 */

--
Sean Chittenden
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PATCHES] Quieting the copyright/startup message...

2004-10-04 Thread John Hansen
 
 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

Won't that violate the BSD licence? 

... John

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [PATCHES] Quieting the copyright/startup message...

2004-10-04 Thread Neil Conway
John Hansen wrote:
Won't that violate the BSD licence?
No; if it did, psql's -q option would already violate the license. The 
BSD license merely says:

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose, without fee, and without a written 
agreement is hereby granted, provided that the above copyright notice 
and this paragraph and the following two paragraphs appear in all copies.

There is no requirement that the program's output mention the license 
terms (perhaps you are thinking of the GPL?)

-Neil
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PATCHES] Quieting the copyright/startup message...

2004-10-04 Thread John Hansen
 There is no requirement that the program's output mention the 
 license terms (perhaps you are thinking of the GPL?)

Yea,. I must have been... :)

... John

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [PATCHES] Quieting the copyright/startup message...

2004-10-04 Thread Neil Conway
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 -  1.101
--- src/bin/psql/startup.c  5 Oct 2004 00:29:47 -
***
*** 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



---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings