Hello

> Npgsql supports sending multiple SQL statements in a single packet via the 
> extended protocol. This works fine, but when the second query SELECTs a value 
> modified by the first's UPDATE, I'm getting a result as if the 
> UPDATE hasn't yet occurred.

Looks like the first updating statement is not committed, assuming that the two 
statements run in different transactions.

> The exact messages send by Npgsql are:
> 
> Parse (UPDATE data SET name='foo' WHERE id=1), statement=unnamed
> Describe (statement=unnamed)
> Bind (statement=unnamed, portal=MQ0)
> Parse (SELECT * FROM data WHERE id=1), statement=unnamed
> Describe (statement=unnamed)
> Bind (statement=unnamed, portal=MQ1)
> Execute (portal=MQ0)
> Close (portal=MQ0)
> Execute (portal=MQ1)
> Close (portal=MQ1)
> Sync

I never used Npgsql so I don't know if there is something missing there. Would 
you need an explicit commit before closing MQ0?
Also I am not in clear what "statement=unnamed" means, but it is used twice. Is 
it possible that the update is overwritten with select before it executes?

Just some thoughts, as I said I know nothing of Npgsql.

BTW: Do you see the change after update in your DB if you look into it with 
another tool (e.g. psql)?

Charles




-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to