Here is an applied patch that suppresses psql \s help display for
platforms like Win32 that don't typically install with readline.
It also prints and error if you try to access it.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: doc/src/sgml/ref/psql-ref.sgml
===================================================================
RCS file: /cvsroot/pgsql-server/doc/src/sgml/ref/psql-ref.sgml,v
retrieving revision 1.122
diff -c -c -r1.122 psql-ref.sgml
*** doc/src/sgml/ref/psql-ref.sgml      20 Sep 2004 18:51:17 -0000      1.122
--- doc/src/sgml/ref/psql-ref.sgml      6 Oct 2004 18:34:40 -0000
***************
*** 1603,1609 ****
          class="parameter">filename</replaceable> is omitted, the history
          is written to the standard output. This option is only available
          if <application>psql</application> is configured to use the
!         <acronym>GNU</acronym> history library.
          </para>
  
          <note>
--- 1603,1609 ----
          class="parameter">filename</replaceable> is omitted, the history
          is written to the standard output. This option is only available
          if <application>psql</application> is configured to use the
!         <acronym>GNU</acronym> readline (or history) library.
          </para>
  
          <note>
Index: src/bin/psql/help.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/psql/help.c,v
retrieving revision 1.93
diff -c -c -r1.93 help.c
*** src/bin/psql/help.c 29 Aug 2004 05:06:54 -0000      1.93
--- src/bin/psql/help.c 6 Oct 2004 18:34:44 -0000
***************
*** 194,200 ****
--- 194,202 ----
        fprintf(output, _("  \\g [FILE]      send query buffer to server (and results 
to file or |pipe)\n"));
        fprintf(output, _("  \\p             show the contents of the query 
buffer\n"));
        fprintf(output, _("  \\r             reset (clear) the query buffer\n"));
+ #ifdef USE_READLINE
        fprintf(output, _("  \\s [FILE]      display history or save it to file\n"));
+ #endif
        fprintf(output, _("  \\w FILE        write query buffer to file\n"));
        fprintf(output, "\n");
  
Index: src/bin/psql/input.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/psql/input.c,v
retrieving revision 1.38
diff -c -c -r1.38 input.c
*** src/bin/psql/input.c        27 Sep 2004 19:16:02 -0000      1.38
--- src/bin/psql/input.c        6 Oct 2004 18:34:44 -0000
***************
*** 209,214 ****
--- 209,216 ----
  
                psql_error("could not save history to file \"%s\": %s\n", fname, 
strerror(errno));
        }
+ #else
+               psql_error("history is not supported on this platform\n");
  #endif
  
        return false;
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to