Top
Best
New

Posted by levkk 4/15/2025

Hacking the Postgres wire protocol(pgdog.dev)
229 points | 50 commentspage 2
antirez 4/15/2025|
> with 4 bytes added for itself

Why one would want to do that? Only reason I can think of is, so that values < 4 can be reserved for future users, like new versions of client-server that agree on 64 bit payload if the first 4 bytes are zero or alike. But there are better ways.

levkk 4/15/2025|
I'm guessing so it's never zero and can't be confused with something else, like a bunch of NULs. There are a few messages that's don't have a payload, e.g. ParseComplete.
antirez 4/15/2025||
Makes sense, thanks.
ustad 4/15/2025||
Has someone done this for MySQL?
achanda358 4/15/2025|
https://vitess.io/
gourabmi 4/15/2025|
Is there something like pg_query for Oracle ? I want to use it for making AST's out of Oracle SQL queries
mdaniel 4/16/2025||
Is there even a grammar for Oracle SQL? I took a swing at trying to slurp it out of the "alt text" of the railroad images in the many, many html files in (e.g. https://docs.oracle.com/en/database/oracle/oracle-database/2... -> https://docs.oracle.com/en/database/oracle/oracle-database/2... ) but then I thankfully moved off any project from that point on that used Oracle and let it go

I'm aware of https://github.com/orafce/orafce and https://github.com/pgoracle before that (the commit history also references ora2pg and searching for that surfaces https://github.com/darold/ora2pg which was just updated yesterday!) but I've never tried to use any of them in anger

emmelaich 4/16/2025||
There are firewalls that claim to do deep packet inspection of Oracle queries for security. They are not without faults.

Perhaps you could directly use or decompile the OCI libs. Though that probably is against some license.