Re: Add PQsendSyncMessage() to libpq - Mailing list pgsql-hackers

From Denis Laxalde
Subject Re: Add PQsendSyncMessage() to libpq
Date
Msg-id 991b791e-bc32-7d14-89f6-cb66c1b52895@dalibo.com
Whole thread Raw
In response to Add PQsendSyncMessage() to libpq  (Anton Kirilov <antonvkirilov@gmail.com>)
Responses Re: Add PQsendSyncMessage() to libpq
List pgsql-hackers
Anton Kirilov wrote:
> I would appeciate your thoughts on my proposal.

This sounds like a useful addition to me. I've played a bit with it in 
Psycopg and it works fine.


diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index a16bbf32ef..e2b32c1379 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -82,6 +82,7 @@ static int    PQsendDescribe(PGconn *conn, char desc_type,
  static int     check_field_number(const PGresult *res, int field_num);
  static void pqPipelineProcessQueue(PGconn *conn);
  static int     pqPipelineFlush(PGconn *conn);
+static int     send_sync_message(PGconn *conn, int flush);

Could (should?) be:
static int     send_sync_message(PGconn *conn, bool flush);


diff --git a/src/test/modules/libpq_pipeline/libpq_pipeline.c 
b/src/test/modules/libpq_pipeline/libpq_pipeline.c
index f48da7d963..829907957a 100644
--- a/src/test/modules/libpq_pipeline/libpq_pipeline.c
+++ b/src/test/modules/libpq_pipeline/libpq_pipeline.c
@@ -244,6 +244,104 @@ test_multi_pipelines(PGconn *conn)
         fprintf(stderr, "ok\n");
  }

+static void
+test_multi_pipelines_noflush(PGconn *conn)
+{

Maybe test_multi_pipelines() could be extended with an additional 
PQsendQueryParams()+PQsendSyncMessage() step instead of adding this 
extra test case?



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: pg_stat_io for the startup process
Next
From: Dave Cramer
Date:
Subject: Re: Request for comment on setting binary format output per session