summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian1997-12-23 21:38:53 +0000
committerBruce Momjian1997-12-23 21:38:53 +0000
commit016090adfd05fe06117e5ca8b9a2777f70e716bc (patch)
tree6e21eb517d6f24386a81dc1ebd92d7aa79aabe92
parent174c500baac4d5c789f735fbaf23279f5d381160 (diff)
Make no-tty not use quiet in psql, fix group by copy failure, fix ccsym to delete tmp files.
-rw-r--r--src/backend/nodes/copyfuncs.c18
-rw-r--r--src/bin/psql/psql.c10
-rwxr-xr-xsrc/tools/ccsym1
3 files changed, 24 insertions, 5 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index be8a509335..794d86da3a 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -509,6 +509,21 @@ _copyAgg(Agg *from)
return newnode;
}
+/* ---------------
+ * _copyGroupClause
+ * --------------
+ */
+static GroupClause *
+_copyGroupClause(GroupClause *from)
+{
+ GroupClause *newnode = makeNode(GroupClause);
+
+ newnode->grpOpoid = from->grpOpoid;
+ newnode->entry = copyObject(from->entry);
+
+ return newnode;
+}
+
/* ----------------
* _copyUnique
@@ -1665,6 +1680,9 @@ copyObject(void *from)
case T_Agg:
retval = _copyAgg(from);
break;
+ case T_GroupClause:
+ retval = _copyGroupClause(from);
+ break;
case T_Unique:
retval = _copyUnique(from);
break;
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index f2fec9d9ef..a7a4983a00 100644
--- a/src/bin/psql/psql.c
+++ b/src/bin/psql/psql.c
@@ -110,7 +110,7 @@ struct winsize
/* declarations for functions in this file */
static void usage(char *progname);
static void slashUsage();
-static void handleCopyOut(PGresult *res, bool quiet, FILE *copystream);
+static void handleCopyOut(PGresult *res, FILE *copystream);
static void
handleCopyIn(PGresult *res, const bool mustprompt,
FILE *copystream);
@@ -994,13 +994,13 @@ SendQuery(bool *success_p, PsqlSettings *pset, const char *query,
case PGRES_COPY_OUT:
*success_p = true;
if (copy_out)
- handleCopyOut(results, pset->quiet, copystream);
+ handleCopyOut(results, copystream);
else
{
if (!pset->quiet)
printf("Copy command returns...\n");
- handleCopyOut(results, pset->quiet, stdout);
+ handleCopyOut(results, stdout);
}
break;
case PGRES_COPY_IN:
@@ -1008,7 +1008,7 @@ SendQuery(bool *success_p, PsqlSettings *pset, const char *query,
if (copy_in)
handleCopyIn(results, false, copystream);
else
- handleCopyIn(results, !pset->quiet, stdin);
+ handleCopyIn(results, !pset->quiet && !pset->notty, stdin);
break;
case PGRES_NONFATAL_ERROR:
case PGRES_FATAL_ERROR:
@@ -2548,7 +2548,7 @@ main(int argc, char **argv)
#define COPYBUFSIZ 8192
static void
-handleCopyOut(PGresult *res, bool quiet, FILE *copystream)
+handleCopyOut(PGresult *res, FILE *copystream)
{
bool copydone;
char copybuf[COPYBUFSIZ];
diff --git a/src/tools/ccsym b/src/tools/ccsym
index 5edb63d1a3..548d58b359 100755
--- a/src/tools/ccsym
+++ b/src/tools/ccsym
@@ -1,5 +1,6 @@
#!/bin/sh
trap "/bin/rm -f /tmp/$$.*" 0 1 2 3 15
+cd /tmp
/bin/cat >$$.c <<EOF
extern int foo;
EOF