Hi,
in my code I do a copy like this (Connection is the PID of a pgsql_connection process):
copy_to(TableName, Data, Connection) ->
{copy_in, [text]} = pgsql_connection:simple_query(["COPY \"", TableName, "\"(time, key, value) FROM STDIN"], Connection),
ok = pgsql_connection:send_copy_data(Data, Connection),
{copy, Count} = pgsql_connection:send_copy_end(Connection),
Count.
Since the Connection is shared by several client processes, there can be some interference here, resulting in errors like "unexpected message type 0x51".
Would it make sense to wrap this three calls into one so they are always executed in sequence?
I can implement this, just wanted to check if this makes sense or if I am using it incorrectly.
Hi,
in my code I do a copy like this (Connection is the PID of a pgsql_connection process):
Since the Connection is shared by several client processes, there can be some interference here, resulting in errors like "unexpected message type 0x51".
Would it make sense to wrap this three calls into one so they are always executed in sequence?
I can implement this, just wanted to check if this makes sense or if I am using it incorrectly.