Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master

Fix formatting verb in error message

Go doesn't distinguish between unsigned and signed in Printf.
latest commit dd347d6844
@johto johto authored


FEMEBE (Front-End, Middle-End, Back-End) is a library for introspection and manipulation of the PostgreSQL wire protocol, colloquially known as FEBE (Front-End/Back-End).

The library is in development and breaking changes to its API will still happen.

FEMEBE works with all currently-supported Postgres versions.


The Postgres protocol abstracts the low-level TCP communication between a client and server into a bidrectional stream of sequential, synchronous messages.

FEMEBE provides an interface to that abstraction, so any Go tool that needs to hook into the protocol can build against a normal package API rather than having to parse the raw protocol at the TCP level.

There are five basic ways to use FEMEBE:

  • Stub out or implement a Postgres client (the former is probably more sensibly done by actually being a client--e.g., using pq--but this may be useful for more esoteric use cases).
  • Stub out or implement (!) a Postges-compatible server
  • Postgres switchboard (route connections and then step out of the way)
  • Listen to the protocol (e.g., a protocol traffic viewer)
  • Manipulate the protocol (e.g., dynamically enrich query results with data from other sources)


FEMEBE can use help in a number of areas:

  • Bug reports, especially with minimal, reproducible test cases
  • Performance benchmarks and improvements
  • API improvements so we can confidently freeze the interface, especially for:
    • Composable (but still performant and simple) Routers
    • Custom error types rather than blind propagation
  • Add server TLS support (TLS for the client piece exists)
  • Support parsing and formatting remaining message types
  • Utility functions for data type management
  • Documentation (especially sample code)
  • Other ideas

To contribute, please open an issue.

Something went wrong with that request. Please try again.