Re: assertion failure w/extended query protocol

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Subject: Re: assertion failure w/extended query protocol
Date: 2012-10-19 22:05:15
Message-ID: 11819.1350684315@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Fri, Oct 19, 2012 at 2:01 PM, Andres Freund <andres(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-10-19 22:13:39 Re: First draft of snapshot snapshot building design document
Previous Message Andrew Dunstan 2012-10-19 21:29:49 Re: [PATCH] Support for Array ELEMENT Foreign Keys