Odd query execution behavior with extended protocol - Mailing list pgsql-hackers

From Shay Rojansky
Subject Odd query execution behavior with extended protocol
Date
Msg-id CADT4RqDX5eTfayzCvDpjy179vW4=dy-wWZbbuJVa4JzSixCriw@mail.gmail.com
Whole thread Raw
Responses Re: Odd query execution behavior with extended protocol  ("Charles Clavadetscher" <clavadetscher@swisspug.org>)
Re: Odd query execution behavior with extended protocol  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
<div dir="ltr"><div style="font-size:12.8px">Hi hackers, some odd behavior has been reported with Npgsql and I'm sure
youcan help.</div><div style="font-size:12.8px"><br /></div><div style="font-size:12.8px">Npgsql supports sending
multipleSQL statements in a single packet via the extended protocol. This works fine, but when the second query SELECTs
avalue modified by the first's UPDATE, I'm getting a result as if the UPDATE hasn't yet occurred.</div><div
style="font-size:12.8px"><br/></div><div style="font-size:12.8px">The exact messages send by Npgsql are:</div><div
style="font-size:12.8px"><br/></div><div style="font-size:12.8px">Parse (UPDATE data SET name='foo' WHERE id=1),
statement=unnamed</div><divstyle="font-size:12.8px">Describe (statement=unnamed)</div><div
style="font-size:12.8px">Bind(statement=unnamed, portal=MQ0)</div><div style="font-size:12.8px">Parse (SELECT * FROM
dataWHERE id=1), statement=unnamed</div><div style="font-size:12.8px">Describe (statement=unnamed)</div><div
style="font-size:12.8px">Bind(statement=unnamed, portal=MQ1)</div><div style="font-size:12.8px">Execute
(portal=MQ0)</div><divstyle="font-size:12.8px">Close (portal=MQ0)</div><div style="font-size:12.8px">Execute
(portal=MQ1)</div><divstyle="font-size:12.8px">Close (portal=MQ1)</div><div style="font-size:12.8px">Sync</div><div
style="font-size:12.8px"><br/></div><div style="font-size:12.8px">Instead of returning the expected 'foo' value set in
thefirst command's UPDATE, I'm getting whatever value was previously there.</div><div style="font-size:12.8px">Note
thatthis happen regardless of whether a transaction is already set and of the isolation level.</div><div
style="font-size:12.8px"><br/></div><div style="font-size:12.8px">Is this the expected behavior, have I misunderstood
theprotocol specs?</div><div style="font-size:12.8px"><br /></div><div style="font-size:12.8px">Thanks for your help,
andplease let me know if you need any more info.</div><div style="font-size:12.8px"><br /></div><div
style="font-size:12.8px">Shay</div></div>

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Parallel Seq Scan
Next
From: Peter Geoghegan
Date:
Subject: Re: More work on SortSupport for text - strcoll() and strxfrm() caching