Re: psql - add SHOW_ALL_RESULTS option

vignesh C <vignesh21@gmail.com>

From: vignesh C <vignesh21@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, daniel@manitou-mail.org, peter.eisentraut@2ndquadrant.com, iwata.aya@jp.fujitsu.com, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2019-09-20T03:53:26Z
Lists: pgsql-hackers
On Fri, Sep 13, 2019 at 1:01 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>
> This v6 is just Fabien's v5, rebased over a very minor conflict, and
> pgindented.  No further changes.  I've marked this Ready for Committer.
>
Should we add function header for the below function to maintain the
common standard of this file:
+
+static void
+AppendNoticeMessage(void *arg, const char *msg)
+{
+ t_notice_messages *notes = (t_notice_messages *) arg;
+
+ appendPQExpBufferStr(notes->in_flip ? &notes->flip : &notes->flop, msg);
+}
+
+static void
+ShowNoticeMessage(t_notice_messages *notes)
+{
+ PQExpBufferData *current = notes->in_flip ? &notes->flip : &notes->flop;
+
+ if (current->data != NULL && *current->data != '\0')
+ pg_log_info("%s", current->data);
+ resetPQExpBuffer(current);
+}
+
+/*
+ * SendQueryAndProcessResults: utility function for use by SendQuery() only
+ *

+static void
+ShowErrorMessage(const PGresult *result)
+{
+ const char *error = PQerrorMessage(pset.db);
+
+ if (strlen(error))
+ pg_log_info("%s", error);
+
+ CheckConnection();
+}

Regards,
Vignesh
EnterpriseDB: http://www.enterprisedb.com



Commits

  1. psql: Show all query results by default

  2. psql: Refactor ProcessResult()

  3. psql: Refactor SendQuery()

  4. psql: Add test for psql behavior on server crash

  5. psql: Additional tests

  6. Improve some psql test code

  7. psql: Fix some scan-build warnings

  8. psql: Add test for handling of replication commands

  9. psql: More tests

  10. psql: Add various tests

  11. psql: Add test for query canceling

  12. Revert "psql: Show all query results by default"

  13. Extend a test case a little