Commit c2dd3c4f authored by Bruce Momjian's avatar Bruce Momjian

Fix for \d on long table names.

parent b20fd6c4
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.131 1998/01/28 20:44:28 momjian Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.132 1998/02/06 17:46:31 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -308,7 +308,7 @@ int ...@@ -308,7 +308,7 @@ int
tableList(PsqlSettings *pset, bool deep_tablelist, char info_type, tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
bool system_tables) bool system_tables)
{ {
char listbuf[256]; char listbuf[512];
int nColumns; int nColumns;
int i; int i;
char *rk; char *rk;
...@@ -436,7 +436,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type, ...@@ -436,7 +436,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
pclose(fout); pclose(fout);
pqsignal(SIGPIPE, SIG_DFL); pqsignal(SIGPIPE, SIG_DFL);
} }
return (0); return 0;
} }
else else
...@@ -458,7 +458,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type, ...@@ -458,7 +458,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
fprintf(stderr, "Couldn't find any tables, sequences or indices!\n"); fprintf(stderr, "Couldn't find any tables, sequences or indices!\n");
break; break;
} }
return (-1); return -1;
} }
} }
...@@ -469,7 +469,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type, ...@@ -469,7 +469,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
int int
rightsList(PsqlSettings *pset) rightsList(PsqlSettings *pset)
{ {
char listbuf[256]; char listbuf[512];
int nColumns; int nColumns;
int i; int i;
int usePipe = 0; int usePipe = 0;
...@@ -537,12 +537,12 @@ rightsList(PsqlSettings *pset) ...@@ -537,12 +537,12 @@ rightsList(PsqlSettings *pset)
pclose(fout); pclose(fout);
pqsignal(SIGPIPE, SIG_DFL); pqsignal(SIGPIPE, SIG_DFL);
} }
return (0); return 0;
} }
else else
{ {
fprintf(stderr, "Couldn't find any tables!\n"); fprintf(stderr, "Couldn't find any tables!\n");
return (-1); return -1;
} }
} }
...@@ -556,7 +556,7 @@ rightsList(PsqlSettings *pset) ...@@ -556,7 +556,7 @@ rightsList(PsqlSettings *pset)
int int
tableDesc(PsqlSettings *pset, char *table, FILE *fout) tableDesc(PsqlSettings *pset, char *table, FILE *fout)
{ {
char descbuf[256]; char descbuf[512];
int nColumns; int nColumns;
char *rtype; char *rtype;
char *rnotnull; char *rnotnull;
...@@ -700,20 +700,18 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout) ...@@ -700,20 +700,18 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
fprintf(fout,"\n"); fprintf(fout,"\n");
} }
fprintf(fout,"+----------------------------------+----------------------------------+-------+\n"); fprintf(fout,"+----------------------------------+----------------------------------+-------+\n");
PQclear(res); PQclear(res);
if (usePipe) if (usePipe)
{ {
pclose(fout); pclose(fout);
pqsignal(SIGPIPE, SIG_DFL); pqsignal(SIGPIPE, SIG_DFL);
} }
return (0); return 0;
} }
else else
{ {
fprintf(stderr, "Couldn't find table %s!\n", table); fprintf(stderr, "Couldn't find table %s!\n", table);
return (-1); return -1;
} }
} }
...@@ -727,7 +725,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout) ...@@ -727,7 +725,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
int int
objectDescription(PsqlSettings *pset, char *object, FILE *fout) objectDescription(PsqlSettings *pset, char *object, FILE *fout)
{ {
char descbuf[256]; char descbuf[512];
int nDescriptions; int nDescriptions;
int i; int i;
PGresult *res; PGresult *res;
...@@ -886,13 +884,13 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout) ...@@ -886,13 +884,13 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout)
pclose(fout); pclose(fout);
pqsignal(SIGPIPE, SIG_DFL); pqsignal(SIGPIPE, SIG_DFL);
} }
return (0); return 0;
} }
else else
{ {
fprintf(stderr, "Couldn't find comments for object %s!\n", object); fprintf(stderr, "Couldn't find comments for object %s!\n", object);
return (-1); return -1;
} }
} }
...@@ -907,7 +905,7 @@ gets_noreadline(char *prompt, FILE *source) ...@@ -907,7 +905,7 @@ gets_noreadline(char *prompt, FILE *source)
{ {
fputs(prompt, stdout); fputs(prompt, stdout);
fflush(stdout); fflush(stdout);
return (gets_fromFile(prompt, stdin)); return gets_fromFile(prompt, stdin);
} }
/* /*
......
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