aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-02-06 17:46:31 +0000
committerBruce Momjian <bruce@momjian.us>1998-02-06 17:46:31 +0000
commitc2dd3c4fef124effc22745d8a1c62d7349a29170 (patch)
tree81971511248f5dd86c5f0fbc3fa270118787d384
parentb20fd6c42d18e567d52cb1b32d801ac4a3fe37d2 (diff)
downloadpostgresql-c2dd3c4fef124effc22745d8a1c62d7349a29170.tar.gz
postgresql-c2dd3c4fef124effc22745d8a1c62d7349a29170.zip
Fix for \d on long table names.
-rw-r--r--src/bin/psql/psql.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index 12aa081a6fa..88e39be767f 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.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
tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
bool system_tables)
{
- char listbuf[256];
+ char listbuf[512];
int nColumns;
int i;
char *rk;
@@ -436,7 +436,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
pclose(fout);
pqsignal(SIGPIPE, SIG_DFL);
}
- return (0);
+ return 0;
}
else
@@ -458,7 +458,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
fprintf(stderr, "Couldn't find any tables, sequences or indices!\n");
break;
}
- return (-1);
+ return -1;
}
}
@@ -469,7 +469,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
int
rightsList(PsqlSettings *pset)
{
- char listbuf[256];
+ char listbuf[512];
int nColumns;
int i;
int usePipe = 0;
@@ -537,12 +537,12 @@ rightsList(PsqlSettings *pset)
pclose(fout);
pqsignal(SIGPIPE, SIG_DFL);
}
- return (0);
+ return 0;
}
else
{
fprintf(stderr, "Couldn't find any tables!\n");
- return (-1);
+ return -1;
}
}
@@ -556,7 +556,7 @@ rightsList(PsqlSettings *pset)
int
tableDesc(PsqlSettings *pset, char *table, FILE *fout)
{
- char descbuf[256];
+ char descbuf[512];
int nColumns;
char *rtype;
char *rnotnull;
@@ -700,20 +700,18 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
fprintf(fout,"\n");
}
fprintf(fout,"+----------------------------------+----------------------------------+-------+\n");
-
PQclear(res);
if (usePipe)
{
pclose(fout);
pqsignal(SIGPIPE, SIG_DFL);
}
- return (0);
-
+ return 0;
}
else
{
fprintf(stderr, "Couldn't find table %s!\n", table);
- return (-1);
+ return -1;
}
}
@@ -727,7 +725,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
int
objectDescription(PsqlSettings *pset, char *object, FILE *fout)
{
- char descbuf[256];
+ char descbuf[512];
int nDescriptions;
int i;
PGresult *res;
@@ -886,13 +884,13 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout)
pclose(fout);
pqsignal(SIGPIPE, SIG_DFL);
}
- return (0);
+ return 0;
}
else
{
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)
{
fputs(prompt, stdout);
fflush(stdout);
- return (gets_fromFile(prompt, stdin));
+ return gets_fromFile(prompt, stdin);
}
/*