Commit 43deb7a4 authored by Bruce Momjian's avatar Bruce Momjian

Fox case-sensitivity for \d and allow trailing ; on backslash commands.

parent 1952f15c
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 . ...@@ -167,7 +167,7 @@ other .
int i; int i;
ScanKeyword *keyword; ScanKeyword *keyword;
for(i = 0; i < strlen(yytext); i++) for(i = strlen(yytext); i >= 0; i--)
if (isupper(yytext[i])) if (isupper(yytext[i]))
yytext[i] = tolower(yytext[i]); yytext[i] = tolower(yytext[i]);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -405,6 +405,10 @@ tableDesc(PsqlSettings * ps, char *table)
/* Build the query */ /* Build the query */
for(i = strlen(table); i >= 0; i--)
if (isupper(table[i]))
table[i] = tolower(table[i]);
descbuf[0] = '\0'; descbuf[0] = '\0';
strcat(descbuf, "SELECT a.attnum, a.attname, t.typname, a.attlen"); strcat(descbuf, "SELECT a.attnum, a.attname, t.typname, a.attlen");
strcat(descbuf, " FROM pg_class c, pg_attribute a, pg_type t "); strcat(descbuf, " FROM pg_class c, pg_attribute a, pg_type t ");
...@@ -1112,6 +1116,9 @@ HandleSlashCmds(PsqlSettings * settings, ...@@ -1112,6 +1116,9 @@ HandleSlashCmds(PsqlSettings * settings,
unescape(cmd, line + 1); /* sets cmd string */ 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 * Originally, there were just single character commands. Now, we define
* some longer, friendly commands, but we have to keep the old single * some longer, friendly commands, but we have to keep the old single
...@@ -1543,7 +1550,6 @@ MainLoop(PsqlSettings * settings, FILE * source) ...@@ -1543,7 +1550,6 @@ MainLoop(PsqlSettings * settings, FILE * source)
} }
slashCmdStatus = -1; slashCmdStatus = -1;
/* slash commands have to be on their own line */
if (!in_quote && query_start[0] == '\\') { if (!in_quote && query_start[0] == '\\') {
slashCmdStatus = HandleSlashCmds(settings, slashCmdStatus = HandleSlashCmds(settings,
query_start, query_start,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment