Skip to content

Commit 33bf73a

Browse files
committed
Make the psql line counter 64-bit so it can handle files > 4gig lines.
David Fetter
1 parent 6932048 commit 33bf73a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/bin/psql/common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.122 2006/07/14 14:52:26 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.123 2006/08/11 19:20:59 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "common.h"
@@ -188,7 +188,7 @@ psql_error(const char *fmt,...)
188188
fflush(pset.queryFout);
189189

190190
if (pset.inputfile)
191-
fprintf(stderr, "%s:%s:%u: ", pset.progname, pset.inputfile, pset.lineno);
191+
fprintf(stderr, "%s:%s:" UINT64_FORMAT ": ", pset.progname, pset.inputfile, pset.lineno);
192192
va_start(ap, fmt);
193193
vfprintf(stderr, _(fmt), ap);
194194
va_end(ap);

src/bin/psql/mainloop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.81 2006/07/14 14:52:26 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.82 2006/08/11 19:20:59 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "mainloop.h"
@@ -44,7 +44,7 @@ MainLoop(FILE *source)
4444
/* Save the prior command source */
4545
FILE *prev_cmd_source;
4646
bool prev_cmd_interactive;
47-
unsigned int prev_lineno;
47+
uint64 prev_lineno;
4848

4949
/* Save old settings */
5050
prev_cmd_source = pset.cur_cmd_source;

src/bin/psql/settings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/settings.h,v 1.27 2006/03/05 15:58:52 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/settings.h,v 1.28 2006/08/11 19:20:59 momjian Exp $
77
*/
88
#ifndef SETTINGS_H
99
#define SETTINGS_H
@@ -50,7 +50,7 @@ typedef struct _psqlSettings
5050
char *inputfile; /* for error reporting */
5151
char *dirname; /* current directory for \s display */
5252

53-
unsigned lineno; /* also for error reporting */
53+
uint64 lineno; /* also for error reporting */
5454

5555
bool timing; /* enable timing of all queries */
5656

0 commit comments

Comments
 (0)