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

Commit72f76d3

Browse files
committed
libpq and psql.c have been modified to do various things they didn't do
before (plus some optimisations/bug fixes et al). I've included a smalldemo transcript below. Note that all of of the displayfunctionality/intelligence you see here, can be had merely by callingthe new LIBPQ PQprint() routine with the appropriate arguments/options,including the HTML3 output guff.submitted by: Julian Assange <proff@suburbia.net>
1 parentbc0bd47 commit72f76d3

File tree

4 files changed

+818
-487
lines changed

4 files changed

+818
-487
lines changed

‎src/bin/monitor/monitor.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/monitor/Attic/monitor.c,v 1.1.1.1 1996/07/09 06:22:13 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/monitor/Attic/monitor.c,v 1.2 1996/07/18 05:48:34 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -642,6 +642,7 @@ handle_execution(char *query)
642642
{
643643
PGresult*result;
644644
intretval=0;
645+
PQprintOptopt;
645646

646647
result=PQexec(conn,query);
647648

@@ -657,11 +658,18 @@ handle_execution(char *query)
657658
break;
658659
casePGRES_TUPLES_OK:
659660
/*PQprintTuples(result,stdout,PrintAttNames,TerseOutput,COLWIDTH); */
660-
if (TerseOutput)
661+
/* if (TerseOutput)
661662
PQdisplayTuples(result,stdout,1,"",PrintAttNames,TerseOutput);
662663
else
663-
PQdisplayTuples(result,stdout,1,"|",PrintAttNames,TerseOutput);
664-
break;
664+
PQdisplayTuples(result,stdout,1,"|",PrintAttNames,TerseOutput); */
665+
memset(&opt,0,sizeofopt);
666+
opt.header=opt.align=opt.standard=1;
667+
if (TerseOutput)
668+
opt.fieldSep="";
669+
else
670+
opt.fieldSep="|";
671+
PQprint(stdout,result,&opt);
672+
break;
665673
casePGRES_COPY_OUT:
666674
handle_copy_out(result);
667675
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp