summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1997-06-29 17:29:28 +0000
committerBruce Momjian <bruce@momjian.us>1997-06-29 17:29:28 +0000
commit43deb7a45f3861e592a9ae325fb9f5e4f290f625 (patch)
treea3658c08d0d2c3c04054a10fdf35dd5b5ae82268
parent1952f15c5c2a56024ca410bf1149de10481748e1 (diff)
downloadpostgresql-43deb7a45f3861e592a9ae325fb9f5e4f290f625.tar.gz
Fox case-sensitivity for \d and allow trailing ; on backslash commands.
-rw-r--r--src/backend/parser/scan.l4
-rw-r--r--src/bin/psql/psql.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index 255b282e3b..ae4200081a 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.12 1997/03/02 01:03:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.13 1997/06/29 17:29:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -167,7 +167,7 @@ other .
int i;
ScanKeyword *keyword;
- for(i = 0; i < strlen(yytext); i++)
+ for(i = strlen(yytext); i >= 0; i--)
if (isupper(yytext[i]))
yytext[i] = tolower(yytext[i]);
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index 7118c6fbfa..1782a07fe8 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.75 1997/06/29 05:06:43 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.76 1997/06/29 17:29:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -405,6 +405,10 @@ tableDesc(PsqlSettings * ps, char *table)
/* Build the query */
+ for(i = strlen(table); i >= 0; i--)
+ if (isupper(table[i]))
+ table[i] = tolower(table[i]);
+
descbuf[0] = '\0';
strcat(descbuf, "SELECT a.attnum, a.attname, t.typname, a.attlen");
strcat(descbuf, " FROM pg_class c, pg_attribute a, pg_type t ");
@@ -1112,6 +1116,9 @@ HandleSlashCmds(PsqlSettings * settings,
unescape(cmd, line + 1); /* sets cmd string */
+ if (strlen(cmd) >= 1 && cmd[strlen(cmd)-1] == ';') /* strip trailing ; */
+ cmd[strlen(cmd)-1] = '\0';
+
/*
* Originally, there were just single character commands. Now, we define
* some longer, friendly commands, but we have to keep the old single
@@ -1543,7 +1550,6 @@ MainLoop(PsqlSettings * settings, FILE * source)
}
slashCmdStatus = -1;
- /* slash commands have to be on their own line */
if (!in_quote && query_start[0] == '\\') {
slashCmdStatus = HandleSlashCmds(settings,
query_start,