Things I learned while interacting with PostgreSQL through the "binary" data format:
- Data isn't transferred in the same format as stored on disk or used internally in Postgres, there's type-specific conversions going on. I assume to offer improved portability and stability.
- Even in the binary format, textual data is converted between the database encoding and whatever you set as 'client_encoding'.
- jsonb columns are converted to/from textual JSON; the 'b' part stays internal to Postgres.
- Dealing with the more complex types (like arrays) is not as painful as I had anticipated; the binary format might actually be easier to work with than the generally recommended textual formats.
- Big-endian everywhere. :blobcatnotlikethis:
- Judging from the Postgres code I've skimmed through, I don't expect the binary format to have much of a performance advantage compared to text, but I still have benchmarks to perform.