Re: [GENERAL] named queries and the wire protocol

2014-03-14 Thread Tom Lane
David Welton writes: > We tracked down the commit that introduced the automatically generated > prepared statement names: > https://github.com/epgsql/epgsql/commit/dabf972f74735d2 > The author wrote "Usage of unnamed prepared statement and portals > leads to unpredictable results in case of conc

Re: [GENERAL] named queries and the wire protocol

2014-03-14 Thread David Welton
Hi, On Thu, Mar 13, 2014 at 1:51 AM, Tom Lane wrote: > David Welton writes: >>> send(State, ?BIND, ["", 0, StatementName, 0, Bin1, Bin2]), >>> send(State, ?EXECUTE, ["", 0, <<0:?int32>>]), >>> send(State, ?CLOSE, [?PREPARED_STATEMENT, StatementName, 0]), >>> send(State, ?SYNC, []), > >> And then

Re: [GENERAL] named queries and the wire protocol

2014-03-12 Thread Tom Lane
David Welton writes: >> send(State, ?BIND, ["", 0, StatementName, 0, Bin1, Bin2]), >> send(State, ?EXECUTE, ["", 0, <<0:?int32>>]), >> send(State, ?CLOSE, [?PREPARED_STATEMENT, StatementName, 0]), >> send(State, ?SYNC, []), > And then the code above. So it's generating a name itself and then > d

Re: [GENERAL] named queries and the wire protocol

2014-03-12 Thread David Welton
Hi, > David Welton writes: >> Specifically, I'm wondering how this code behaves in the case that the >> Execute runs into trouble: > >> https://github.com/epgsql/epgsql/blob/0e84176be4b54fb712d1cc227a2b91c24b7a66ab/src/pgsql_sock.erl#L199 > > I guess you mean this: Yes > command({equery, Statem

Re: [GENERAL] named queries and the wire protocol

2014-03-12 Thread Tom Lane
David Welton writes: > Specifically, I'm wondering how this code behaves in the case that the > Execute runs into trouble: > https://github.com/epgsql/epgsql/blob/0e84176be4b54fb712d1cc227a2b91c24b7a66ab/src/pgsql_sock.erl#L199 I guess you mean this: command({equery, Statement, Parameters}, Sta