mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-24 18:55:04 +08:00
Update psql startup banner to be shorter, suggest "help" for help.
Add a few "help" entries. Move \g help entry into "General". Update psql version mismatch warning text. Joshua D. Drake
This commit is contained in:
parent
7adddb4002
commit
9263d86f59
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.205 2008/05/16 16:59:05 momjian Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.206 2008/05/16 17:17:00 momjian Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -571,13 +571,10 @@ $ <userinput>psql "service=myservice sslmode=require"</userinput>
|
|||||||
the string <literal>=></literal>. For example:
|
the string <literal>=></literal>. For example:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
$ <userinput>psql testdb</userinput>
|
$ <userinput>psql testdb</userinput>
|
||||||
Welcome to psql &version;, the PostgreSQL interactive terminal.
|
psql (&version;)
|
||||||
|
Type "help" for help.
|
||||||
|
|
||||||
Type: \copyright for distribution terms
|
test=>
|
||||||
\h for help with SQL commands
|
|
||||||
\? for help with psql commands
|
|
||||||
\g or terminate with semicolon to execute query
|
|
||||||
\q to quit
|
|
||||||
|
|
||||||
testdb=>
|
testdb=>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.46 2008/01/23 02:04:47 tgl Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.47 2008/05/16 17:17:00 momjian Exp $ -->
|
||||||
|
|
||||||
<chapter id="tutorial-start">
|
<chapter id="tutorial-start">
|
||||||
<title>Getting Started</title>
|
<title>Getting Started</title>
|
||||||
@ -329,13 +329,8 @@ createdb: database creation failed: ERROR: permission denied to create database
|
|||||||
In <command>psql</command>, you will be greeted with the following
|
In <command>psql</command>, you will be greeted with the following
|
||||||
message:
|
message:
|
||||||
<screen>
|
<screen>
|
||||||
Welcome to psql &version;, the PostgreSQL interactive terminal.
|
psql (&version;)
|
||||||
|
Type "help" for help.
|
||||||
Type: \copyright for distribution terms
|
|
||||||
\h for help with SQL commands
|
|
||||||
\? for help with psql commands
|
|
||||||
\g or terminate with semicolon to execute query
|
|
||||||
\q to quit
|
|
||||||
|
|
||||||
mydb=>
|
mydb=>
|
||||||
</screen>
|
</screen>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.127 2008/05/14 15:30:22 momjian Exp $
|
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.128 2008/05/16 17:17:00 momjian Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
|
|
||||||
@ -170,13 +170,13 @@ slashUsage(unsigned short int pager)
|
|||||||
*/
|
*/
|
||||||
fprintf(output, _("General\n"));
|
fprintf(output, _("General\n"));
|
||||||
fprintf(output, _(" \\copyright show PostgreSQL usage and distribution terms\n"));
|
fprintf(output, _(" \\copyright show PostgreSQL usage and distribution terms\n"));
|
||||||
|
fprintf(output, _(" \\g [FILE] or ; execute query (and send results to file or |pipe)\n"));
|
||||||
fprintf(output, _(" \\h [NAME] help on syntax of SQL commands, * for all commands\n"));
|
fprintf(output, _(" \\h [NAME] help on syntax of SQL commands, * for all commands\n"));
|
||||||
fprintf(output, _(" \\q quit psql\n"));
|
fprintf(output, _(" \\q quit psql\n"));
|
||||||
fprintf(output, "\n");
|
fprintf(output, "\n");
|
||||||
|
|
||||||
fprintf(output, _("Query Buffer\n"));
|
fprintf(output, _("Query Buffer\n"));
|
||||||
fprintf(output, _(" \\e [FILE] edit the query buffer (or file) with external editor\n"));
|
fprintf(output, _(" \\e [FILE] edit the query buffer (or file) with external editor\n"));
|
||||||
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, _(" \\p show the contents of the query buffer\n"));
|
||||||
fprintf(output, _(" \\r reset (clear) the query buffer\n"));
|
fprintf(output, _(" \\r reset (clear) the query buffer\n"));
|
||||||
#ifdef USE_READLINE
|
#ifdef USE_READLINE
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.90 2008/04/05 03:40:15 tgl Exp $
|
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.91 2008/05/16 17:17:00 momjian Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
#include "mainloop.h"
|
#include "mainloop.h"
|
||||||
@ -177,10 +177,13 @@ MainLoop(FILE *source)
|
|||||||
(line[4] == '\0' || line[4] == ';' || isspace((unsigned char) line[4])))
|
(line[4] == '\0' || line[4] == ';' || isspace((unsigned char) line[4])))
|
||||||
{
|
{
|
||||||
free(line);
|
free(line);
|
||||||
puts(_("You are using psql, the command-line interface to PostgreSQL."));
|
puts(_("\nYou are using psql, the command-line interface to PostgreSQL."));
|
||||||
puts(_("Enter SQL commands, or type \\? for a list of backslash options."));
|
puts(_("\t\\? for psql help"));
|
||||||
puts(_("Use \\h for SQL command help."));
|
puts(_("\t\\h or \\help for SQL help\n"));
|
||||||
puts(_("Use \\q to quit."));
|
puts(_("\t\\g or \";\" to execute a query"));
|
||||||
|
puts(_("\t\\q to quit psql\n"));
|
||||||
|
puts(_("\t\\copyright to view the copyright\n"));
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.147 2008/05/08 17:04:26 momjian Exp $
|
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.148 2008/05/16 17:17:00 momjian Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
|
|
||||||
@ -317,33 +317,26 @@ main(int argc, char *argv[])
|
|||||||
server_version = server_ver_str;
|
server_version = server_ver_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(_("Welcome to %s %s (server %s), the PostgreSQL interactive terminal.\n\n"),
|
printf(_("%s (%s, server %s)\n"),
|
||||||
pset.progname, PG_VERSION, server_version);
|
pset.progname, PG_VERSION, server_version);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf(_("Welcome to %s %s, the PostgreSQL interactive terminal.\n\n"),
|
printf("%s (%s)\n", pset.progname, PG_VERSION);
|
||||||
pset.progname, PG_VERSION);
|
|
||||||
|
|
||||||
printf(_("Type: \\copyright for distribution terms\n"
|
|
||||||
" \\h for help with SQL commands\n"
|
|
||||||
" \\? for help with psql commands\n"
|
|
||||||
" \\g or terminate with semicolon to execute query\n"
|
|
||||||
" \\q to quit\n\n"));
|
|
||||||
|
|
||||||
if (pset.sversion / 100 != client_ver / 100)
|
if (pset.sversion / 100 != client_ver / 100)
|
||||||
printf(_("WARNING: You are connected to a server with major version %d.%d,\n"
|
printf(_("WARNING: %s version %d.%d, server version %d.%d.\n"
|
||||||
"but your %s client is major version %d.%d. Some backslash commands,\n"
|
" Some psql features might not work.\n"),
|
||||||
"such as \\d, might not work properly.\n\n"),
|
pset.progname, client_ver / 10000, (client_ver / 100) % 100,
|
||||||
pset.sversion / 10000, (pset.sversion / 100) % 100,
|
pset.sversion / 10000, (pset.sversion / 100) % 100);
|
||||||
pset.progname,
|
|
||||||
client_ver / 10000, (client_ver / 100) % 100);
|
|
||||||
|
|
||||||
#ifdef USE_SSL
|
|
||||||
printSSLInfo();
|
|
||||||
#endif
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
checkWin32Codepage();
|
checkWin32Codepage();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_SSL
|
||||||
|
printSSLInfo();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
printf(_("Type \"help\" for help.\n\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pset.notty)
|
if (!pset.notty)
|
||||||
@ -707,7 +700,7 @@ printSSLInfo(void)
|
|||||||
return; /* no SSL */
|
return; /* no SSL */
|
||||||
|
|
||||||
SSL_get_cipher_bits(ssl, &sslbits);
|
SSL_get_cipher_bits(ssl, &sslbits);
|
||||||
printf(_("SSL connection (cipher: %s, bits: %i)\n\n"),
|
printf(_("SSL connection (cipher: %s, bits: %i)\n"),
|
||||||
SSL_get_cipher(ssl), sslbits);
|
SSL_get_cipher(ssl), sslbits);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -729,9 +722,9 @@ checkWin32Codepage(void)
|
|||||||
concp = GetConsoleCP();
|
concp = GetConsoleCP();
|
||||||
if (wincp != concp)
|
if (wincp != concp)
|
||||||
{
|
{
|
||||||
printf(_("Warning: Console code page (%u) differs from Windows code page (%u)\n"
|
printf(_("WARNING: Console code page (%u) differs from Windows code page (%u)\n"
|
||||||
" 8-bit characters might not work correctly. See psql reference\n"
|
" 8-bit characters might not work correctly. See psql reference\n"
|
||||||
" page \"Notes for Windows users\" for details.\n\n"),
|
" page \"Notes for Windows users\" for details.\n"),
|
||||||
concp, wincp);
|
concp, wincp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user