Re: [Xen-devel] [OSSTEST PATCH 5/7] Database locking: Tcl: for errorCode, use pg_exec, not pg_execute

2016-01-14 Thread Ian Campbell
On Tue, 2016-01-12 at 15:39 +, Ian Jackson wrote: > > > of the statement handle (-cmdTuples vs -numTuples).  But all uses in > > > the codebase are now fine for this distinction. > > > > Does this imply that db-execute-array could be renamed db-execute- > > select, > > or even just db-select?

Re: [Xen-devel] [OSSTEST PATCH 5/7] Database locking: Tcl: for errorCode, use pg_exec, not pg_execute

2016-01-12 Thread Ian Jackson
Ian Campbell writes ("Re: [OSSTEST PATCH 5/7] Database locking: Tcl: for errorCode, use pg_exec, not pg_execute"): > On Thu, 2016-01-07 at 19:38 +, Ian Jackson wrote: > > A wrinkle is that as a result it is no longer possible to use > > db-execute on a SELECT statement nor db-execute-array on

Re: [Xen-devel] [OSSTEST PATCH 5/7] Database locking: Tcl: for errorCode, use pg_exec, not pg_execute

2016-01-08 Thread Ian Campbell
On Thu, 2016-01-07 at 19:38 +, Ian Jackson wrote: > We would like to be able to retry db transactions.  To do this we need > to know why they failed (if they did). > > But pg_execute does not set errorCode.  (This is clearly a bug.)  And > since it immediately discards a failed statement, any

[Xen-devel] [OSSTEST PATCH 5/7] Database locking: Tcl: for errorCode, use pg_exec, not pg_execute

2016-01-07 Thread Ian Jackson
We would like to be able to retry db transactions. To do this we need to know why they failed (if they did). But pg_execute does not set errorCode. (This is clearly a bug.) And since it immediately discards a failed statement, any error information has been lost by the time pg_execute returns.