Skip to content

Commit c2dd3c4

Browse files
committed
Fix for \d on long table names.
1 parent b20fd6c commit c2dd3c4

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/bin/psql/psql.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.131 1998/01/28 20:44:28 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.132 1998/02/06 17:46:31 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -308,7 +308,7 @@ int
308308
tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
309309
bool system_tables)
310310
{
311-
char listbuf[256];
311+
char listbuf[512];
312312
int nColumns;
313313
int i;
314314
char *rk;
@@ -436,7 +436,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
436436
pclose(fout);
437437
pqsignal(SIGPIPE, SIG_DFL);
438438
}
439-
return (0);
439+
return 0;
440440

441441
}
442442
else
@@ -458,7 +458,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
458458
fprintf(stderr, "Couldn't find any tables, sequences or indices!\n");
459459
break;
460460
}
461-
return (-1);
461+
return -1;
462462
}
463463
}
464464

@@ -469,7 +469,7 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
469469
int
470470
rightsList(PsqlSettings *pset)
471471
{
472-
char listbuf[256];
472+
char listbuf[512];
473473
int nColumns;
474474
int i;
475475
int usePipe = 0;
@@ -537,12 +537,12 @@ rightsList(PsqlSettings *pset)
537537
pclose(fout);
538538
pqsignal(SIGPIPE, SIG_DFL);
539539
}
540-
return (0);
540+
return 0;
541541
}
542542
else
543543
{
544544
fprintf(stderr, "Couldn't find any tables!\n");
545-
return (-1);
545+
return -1;
546546
}
547547
}
548548

@@ -556,7 +556,7 @@ rightsList(PsqlSettings *pset)
556556
int
557557
tableDesc(PsqlSettings *pset, char *table, FILE *fout)
558558
{
559-
char descbuf[256];
559+
char descbuf[512];
560560
int nColumns;
561561
char *rtype;
562562
char *rnotnull;
@@ -700,20 +700,18 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
700700
fprintf(fout,"\n");
701701
}
702702
fprintf(fout,"+----------------------------------+----------------------------------+-------+\n");
703-
704703
PQclear(res);
705704
if (usePipe)
706705
{
707706
pclose(fout);
708707
pqsignal(SIGPIPE, SIG_DFL);
709708
}
710-
return (0);
711-
709+
return 0;
712710
}
713711
else
714712
{
715713
fprintf(stderr, "Couldn't find table %s!\n", table);
716-
return (-1);
714+
return -1;
717715
}
718716
}
719717

@@ -727,7 +725,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
727725
int
728726
objectDescription(PsqlSettings *pset, char *object, FILE *fout)
729727
{
730-
char descbuf[256];
728+
char descbuf[512];
731729
int nDescriptions;
732730
int i;
733731
PGresult *res;
@@ -886,13 +884,13 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout)
886884
pclose(fout);
887885
pqsignal(SIGPIPE, SIG_DFL);
888886
}
889-
return (0);
887+
return 0;
890888

891889
}
892890
else
893891
{
894892
fprintf(stderr, "Couldn't find comments for object %s!\n", object);
895-
return (-1);
893+
return -1;
896894
}
897895
}
898896

@@ -907,7 +905,7 @@ gets_noreadline(char *prompt, FILE *source)
907905
{
908906
fputs(prompt, stdout);
909907
fflush(stdout);
910-
return (gets_fromFile(prompt, stdin));
908+
return gets_fromFile(prompt, stdin);
911909
}
912910

913911
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy