Re: assertion failure w/extended query protocol - Mailing list pgsql-hackers

From Tom Lane
Subject Re: assertion failure w/extended query protocol
Date
Msg-id 11819.1350684315@sss.pgh.pa.us
Whole thread Raw
In response to Re: assertion failure w/extended query protocol  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: assertion failure w/extended query protocol  (Andres Freund <andres@2ndquadrant.com>)
Re: assertion failure w/extended query protocol  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Oct 19, 2012 at 2:01 PM, Andres Freund <andres@2ndquadrant.com> wrote:
>> Btw, do you plan to submit that psql patch at some point? I repeatedly wished
>> to be able to use the extended protocol without writing code or misusing
>> pgbench exactly to test stuff like this.

> I didn't think it would be accepted, but if you think it's useful to
> have, consider it submitted.  If you review the code and it seems OK
> (or can be fixed to be OK), I'm happy to write some user
> documentation.  I'm not sure it actually handles all the cases right
> now but perhaps you could have a look.

It's hard to visualize a use for this except for testing purposes, but
that might be sufficient reason to have it.  One thing that would be
pretty cool is to be able to run the regression tests in extended
protocol.  I hacked that up really quickly with this:

diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index f8e1921e56be90bfa88707e9241afa139f72ac91..03875c917afd1b2339f91fe2b44836e7e6ed283b 100644
*** a/src/test/regress/pg_regress_main.c
--- b/src/test/regress/pg_regress_main.c
*************** psql_start_test(const char *testname,
*** 64,70 ****                            "%s ", launcher);      snprintf(psql_cmd + offset, sizeof(psql_cmd) -
offset,
!              SYSTEMQUOTE "\"%s%spsql\" -X -a -q -d \"%s\" < \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,              psqldir ?
psqldir: "",              psqldir ? "/" : "",              dblist->str,
 
--- 64,70 ----                            "%s ", launcher);      snprintf(psql_cmd + offset, sizeof(psql_cmd) -
offset,
!              SYSTEMQUOTE "\"%s%spsql\" -X -v PROTOCOL=extended -a -q -d \"%s\" < \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
          psqldir ? psqldir : "",              psqldir ? "/" : "",              dblist->str,
 

and tried it, and saw a number of failures.  Some of them were readily
explainable (such as the current query showing up in pg_cursors ---
maybe we should prevent that?) and some were not.  It might be worth
investigating more carefully.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [PATCH] Support for Array ELEMENT Foreign Keys
Next
From: Andres Freund
Date:
Subject: Re: First draft of snapshot snapshot building design document