Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb3f66d1

Browse files
committed
Add command '\pset footer' to psql to turn off default "(x rows)" footer.
1 parentbbc3920 commitb3f66d1

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

‎doc/src/sgml/ref/psql-ref.sgml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.51 2001/05/09 17:29:10 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.52 2001/05/12 19:44:45 petere Exp $
33
Postgres documentation
44
-->
55

@@ -898,6 +898,15 @@ lo_import 152801
898898
</listitem>
899899
</varlistentry>
900900

901+
<varlistentry>
902+
<term><literal>footer</literal></term>
903+
<listitem>
904+
<para>
905+
Toggles the display of the default footer <literal>(x rows)</literal>.
906+
</para>
907+
</listitem>
908+
</varlistentry>
909+
901910
<varlistentry>
902911
<term><literal>recordsep</literal></term>
903912
<listitem>

‎src/bin/psql/command.c

Lines changed: 13 additions & 1 deletion
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/command.c,v 1.53 2001/05/1217:37:15 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.54 2001/05/1219:44:46 petere Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"command.h"
@@ -1796,6 +1796,18 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
17961796
}
17971797
}
17981798

1799+
/* disable "(x rows)" footer */
1800+
elseif (strcmp(param,"footer")==0)
1801+
{
1802+
popt->default_footer= !popt->default_footer;
1803+
if (!quiet)
1804+
{
1805+
if (popt->default_footer)
1806+
puts("Default footer is on.");
1807+
else
1808+
puts("Default footer is off.");
1809+
}
1810+
}
17991811

18001812
else
18011813
{

‎src/bin/psql/print.c

Lines changed: 2 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.18 2001/03/22 04:00:22 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.19 2001/05/12 19:44:46 petere Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"print.h"
@@ -1058,7 +1058,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
10581058

10591059
if (opt->footers)
10601060
footers=opt->footers;
1061-
elseif (!opt->topt.expanded)
1061+
elseif (!opt->topt.expanded&&opt->default_footer)
10621062
{
10631063
footers=calloc(2,sizeof(*footers));
10641064
if (!footers)

‎src/bin/psql/print.h

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.h,v 1.8 2000/04/1217:16:23 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/print.h,v 1.9 2001/05/1219:44:46 petere Exp $
77
*/
88
#ifndefPRINT_H
99
#definePRINT_H
@@ -64,6 +64,7 @@ typedef struct _printQueryOpt
6464
char*title;/* override title */
6565
char**footers;/* override footer (default is "(xx
6666
* rows)") */
67+
booldefault_footer;/* print default footer if footers==NULL */
6768
}printQueryOpt;
6869

6970
/*
@@ -72,7 +73,7 @@ typedef struct _printQueryOpt
7273
* It calls the printTable above with all the things set straight.
7374
*/
7475
void
75-
printQuery(constPGresult*result,constprintQueryOpt*opt,FILE*fout);
76+
printQuery(constPGresult*result,constprintQueryOpt*opt,FILE*fout);
7677

7778

7879
#endif/* PRINT_H */

‎src/bin/psql/startup.c

Lines changed: 2 additions & 1 deletion
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/startup.c,v 1.47 2001/05/06 17:38:32 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.48 2001/05/12 19:44:46 petere Exp $
77
*/
88
#include"postgres_fe.h"
99

@@ -135,6 +135,7 @@ main(int argc, char *argv[])
135135
pset.queryFout=stdout;
136136
pset.popt.topt.border=1;
137137
pset.popt.topt.pager= true;
138+
pset.popt.default_footer= true;
138139

139140
SetVariable(pset.vars,"VERSION",PG_VERSION_STR);
140141

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp