You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
decodeServerMessage first parses header, gets required number of bytes to read and reads them using callback.
So this protocol can read unknown in advance size of data. Unfortunately current implementation is does N copies where N is number of times driver needs to read the data, that may be suboptimal on the long messages.
Does this explanation makes sense to you? Or have I missed anything?
I was trying to build a postgres protocol compatible server application on top of
postgres-wire
, but I found that the decoder implementation is not streamlined.For example, here(https://github.com/postgres-haskell/postgres-wire/blob/master/src/Database/PostgreSQL/Driver/Connection.hs#L174) you need to hard code the length of the buffer, and this code is actually problematic because it might only receive an arbitrary length of data.
The text was updated successfully, but these errors were encountered: