aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/psql.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index 2902d66fdbc..c5e0816d1e2 100644
--- a/src/bin/psql/psql.c
+++ b/src/bin/psql/psql.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.35 1996/11/26 07:38:28 bryanh Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.36 1996/11/30 03:41:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1272,6 +1272,13 @@ MainLoop(PsqlSettings * settings, FILE * source)
line = strdup(query);
query[0] = '\0';
} else {
+ sprintf(settings->prompt, "%s%s", PQdb(settings->db), PROMPT);
+ if (in_quote)
+ settings->prompt[strlen(settings->prompt)-3] = '\'';
+ else if (query[0] != '\0' && !querySent)
+ settings->prompt[strlen(settings->prompt)-3] = '-';
+ else
+ settings->prompt[strlen(settings->prompt)-3] = '=';
line = GetNextLine(settings->prompt, source);
if (interactive && settings->useReadline && line != NULL)
add_history(line); /* save non-empty lines in history */