Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bbd5c21

Browse files
committed
Make no-tty not use quiet in psql, fix group by copy failure, fix ccsym to delete tmp files.
1 parent 6b2e7e1 commit bbd5c21

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

src/backend/nodes/copyfuncs.c

+19-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.23 1997/12/23 19:53:30 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.24 1997/12/23 21:38:25 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -509,6 +509,21 @@ _copyAgg(Agg *from)
509509
return newnode;
510510
}
511511

512+
/* ---------------
513+
* _copyGroupClause
514+
* --------------
515+
*/
516+
static GroupClause *
517+
_copyGroupClause(GroupClause *from)
518+
{
519+
GroupClause *newnode = makeNode(GroupClause);
520+
521+
newnode->grpOpoid = from->grpOpoid;
522+
newnode->entry = copyObject(from->entry);
523+
524+
return newnode;
525+
}
526+
512527

513528
/* ----------------
514529
* _copyUnique
@@ -1665,6 +1680,9 @@ copyObject(void *from)
16651680
case T_Agg:
16661681
retval = _copyAgg(from);
16671682
break;
1683+
case T_GroupClause:
1684+
retval = _copyGroupClause(from);
1685+
break;
16681686
case T_Unique:
16691687
retval = _copyUnique(from);
16701688
break;

src/bin/psql/psql.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.121 1997/12/22 20:03:53 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.122 1997/12/23 21:38:40 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -110,7 +110,7 @@ struct winsize
110110
/* declarations for functions in this file */
111111
static void usage(char *progname);
112112
static void slashUsage();
113-
static void handleCopyOut(PGresult *res, bool quiet, FILE *copystream);
113+
static void handleCopyOut(PGresult *res, FILE *copystream);
114114
static void
115115
handleCopyIn(PGresult *res, const bool mustprompt,
116116
FILE *copystream);
@@ -994,21 +994,21 @@ SendQuery(bool *success_p, PsqlSettings *pset, const char *query,
994994
case PGRES_COPY_OUT:
995995
*success_p = true;
996996
if (copy_out)
997-
handleCopyOut(results, pset->quiet, copystream);
997+
handleCopyOut(results, copystream);
998998
else
999999
{
10001000
if (!pset->quiet)
10011001
printf("Copy command returns...\n");
10021002

1003-
handleCopyOut(results, pset->quiet, stdout);
1003+
handleCopyOut(results, stdout);
10041004
}
10051005
break;
10061006
case PGRES_COPY_IN:
10071007
*success_p = true;
10081008
if (copy_in)
10091009
handleCopyIn(results, false, copystream);
10101010
else
1011-
handleCopyIn(results, !pset->quiet, stdin);
1011+
handleCopyIn(results, !pset->quiet && !pset->notty, stdin);
10121012
break;
10131013
case PGRES_NONFATAL_ERROR:
10141014
case PGRES_FATAL_ERROR:
@@ -2548,7 +2548,7 @@ main(int argc, char **argv)
25482548
#define COPYBUFSIZ 8192
25492549

25502550
static void
2551-
handleCopyOut(PGresult *res, bool quiet, FILE *copystream)
2551+
handleCopyOut(PGresult *res, FILE *copystream)
25522552
{
25532553
bool copydone;
25542554
char copybuf[COPYBUFSIZ];

src/tools/ccsym

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22
trap "/bin/rm -f /tmp/$$.*" 0 1 2 3 15
3+
cd /tmp
34
/bin/cat >$$.c <<EOF
45
extern int foo;
56
EOF

0 commit comments

Comments
 (0)