This library allows you to (de-)serialize bytes of PostgreSQL protocol messages.
varmessage=newQueryMessage();message.Query="SELECT * FROM table1";varbytes=serializer.Serialize(message);// Byte sequence conforming to PostgreSQL protocolvarbytes=new[]{(byte)'Z',(byte)'I'};varmessage=serializer.Deserialize(bytes);// PostgreSQL message (ReadyForQueryMessage)There is also a Deserialize method that takes a stream as argument.
For PoC purposes only, this supports only simple queries, extended queries, and messages used around them. This does not support replication or copying.