mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
fix: clean up formatting of \d tablename in psql
submitted by: Bruce Momjian (root@candle.pha.pa.us)
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.2 1996/07/16 06:37:28 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.3 1996/07/16 06:58:12 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -321,9 +321,9 @@ tableDesc (PGconn* conn, char* table)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
printf ("\nTable = %s\n", table);
|
printf ("\nTable = %s\n", table);
|
||||||
printf ("+----------------------------------+----------------------------------+-------+\n");
|
printf ("+----------------------------------+----------------------------------+--------+\n");
|
||||||
printf ("| Field | Type | Length|\n");
|
printf ("| Field | Type | Length |\n");
|
||||||
printf ("+----------------------------------+----------------------------------+-------+\n");
|
printf ("+----------------------------------+----------------------------------+--------+\n");
|
||||||
|
|
||||||
/* next, print out the instances */
|
/* next, print out the instances */
|
||||||
for (i=0; i < PQntuples(res); i++) {
|
for (i=0; i < PQntuples(res); i++) {
|
||||||
@ -355,13 +355,13 @@ tableDesc (PGconn* conn, char* table)
|
|||||||
free(newname);
|
free(newname);
|
||||||
}
|
}
|
||||||
if (rsize > 0)
|
if (rsize > 0)
|
||||||
printf ("%-6i |", rsize);
|
printf (" %-6i |", rsize);
|
||||||
else
|
else
|
||||||
printf ("%-6s |", "var");
|
printf (" %-6s |", "var");
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
printf ("+----------------------------------+----------------------------------+-------+\n");
|
printf ("+----------------------------------+----------------------------------+--------+\n");
|
||||||
|
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
return (0);
|
return (0);
|
||||||
|
Reference in New Issue
Block a user