Skip to content

Commit 6260c7c

Browse files
committed
Don't dump core on empty table.
1 parent 8be6847 commit 6260c7c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/psql/print.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.25 2001/10/30 05:38:56 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.26 2002/04/24 15:56:38 tgl Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "print.h"
@@ -1073,7 +1073,8 @@ printTable(const char *title,
10731073
if (cells)
10741074
for (ptr = cells; *ptr; ptr++)
10751075
row_count++;
1076-
row_count /= col_count;
1076+
if (col_count > 0)
1077+
row_count /= col_count;
10771078

10781079
if (opt->expanded)
10791080
lines = (col_count + 1) * row_count;

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