Re:Parsing the Postgres protocol – logging executed statements
by bearjaws on Thursday March 14, 2024 @04:43PM
(#39708722)
Yeah I have tinkered with the PG protocol to de-identify data as its transmitted and the error handling is pretty bare bones. I think its reflected pretty well in how connection errors and even query errors come back as "you have an error" from Postgres most times lol.
Neon databases scale to zero, so the proxy needs to spin up databases on the fly. The proxy doesn't do that but it knows if the databases is running and asks our control plane to schedule it if it isn't. It's a fun service to maintain.
The biggest pain is error handling. Postgres is really bad for error messages and codes. The only available code we can use is usually protocol violation...
[0]: https://neon.tech/ [1]: https://github.com/neondatabase/neon/tree/main/proxy