Serializing function converts value pointed to by val to PSQL network protocol format,
writing it to byte buffer 'to' and returning number of bytes written, -1 if the value
is null, and -2 if 'to' is too small.
If result is less than -2, absolute value is the amount of bytes that is
required to fully serialize the value.
Serializing function converts value pointed to by val to PSQL network protocol format, writing it to byte buffer 'to' and returning number of bytes written, -1 if the value is null, and -2 if 'to' is too small. If result is less than -2, absolute value is the amount of bytes that is required to fully serialize the value.