Sergey Prokhorov
Sergey Prokhorov
I personally don't have use cases for it, but I just noticed that most of the PG drivers supports this. Eg, elixir: https://hexdocs.pm/postgrex/Postgrex.html#stream/4 Python: http://initd.org/psycopg/docs/usage.html#using-copy-to-and-copy-from Rust: https://docs.rs/postgres/0.15.1/postgres/stmt/struct.Statement.html#method.copy_in NodeJS: https://github.com/brianc/node-pg-copy-streams Go...
I was thinking about implementing it as an Erlang's [io protocol](https://erlang.org/doc/apps/stdlib/io_protocol.html). So, smth like ```erlang {ok, IoDescriptor} = epgsql:start_copy(C, "COPY my_table FROM stdin ..."), ok = file:write(IoDescriptor, ), io:format(IoDescriptor, "blabla~pblabla\n",...
@dszoboszlay the problem is that epgsql is quite good at conversion from Erlang types to postgres binary wire protocol, but it doesn't really know how to convert to/from text representation....
While thinking about it, noticed one complication: epgsql currently doesn't have any TCP flow control in it: we use `{active, true}` to receive TCP data from PostgreSQL and we use...
Made a PR to add support for `COPY ... FROM STDIN` (to transfer data from Erlang to Postgres) https://github.com/epgsql/epgsql/pull/248 `COPY .. TO STDOUT` would require some rework of how we...
Interesting. ```erlang handle_message(90, "I" ``` 90 means character `Z`, which is a code for ["ready for query"](https://github.com/epgsql/epgsql/blob/devel/include/protocol.hrl#L43). And `undefined:handle_message` means you entered the part of the code that is supposed...
ok, looking into `epgsql_implementation.ex`, it seems you use `squery`, so, this shouldn't be a problem. But are you saying this happens somewhere not in a connection phase, but after there...
another thing I noticed: in your state you have this ` :on_message` atom. You could only have it on connections that are NOT in replication mode, but in normal command-processing...
So, in short: While our connection was idle (not executing any particular command), having at the same time [#state.handler == on_message](https://github.com/epgsql/epgsql/blob/74b32770345c01f4bb3cfd898029a083a5c28bd4/src/epgsql_sock.erl#L90) AND already half-initialized replication state [#state.copy_state = #repl{}](https://github.com/epgsql/epgsql/blob/b9d745ecc7f001dc5200cc2ab72dbd462432f370/src/epgsql_sock.erl#L95) (this...
btw, you are using epgsql 4.2.0. Could you try if 4.5.0 also has this problem? It's not that much changes since then, especially in regards to replication, but worth a...