* Not reusing PostgreSQL's parser does make it somewhat more likely
for there to be differences in complex SQL queries compared to
** Unknown because I didn't take the time to look into it. Feel free to message me and I'll fill it in.
And a special shoutout to ClickHouse that according to its config example can pretend to be PostgreSQL and, separately, MySQL. But since this isn't documented nor can I find the PostgreSQL parser code (but I can find the MySQL parser code) I won't include it in this list.
I'm sure I missed some. Message me with other PostgreSQL wire-compatible databases I should include here!
Syntax and engine support
A parser is only the start of compatibility though. Just because a parser supports some syntax doesn't mean that the engine supports it too. But you can be more sure that if a parser doesn't support some syntax, the engine can't support it either (unless the project keeps dead code around, which isn't common).
And an implementation that falls behind on parser support is likely to fall behind in other areas of compatibility. This is not to say that one vendor is better or worse. Excellent engineering can almost always overcome these types of obstacles. But there are always implications to technical design decisions.
So just looking at parser support is not enough to talk about PostgreSQL query or semantic compatibility. But it is a starting point.
Wire protocol edge cases, another time
Lastly, I said this post was about wire protocols but then I ended
up focusing on the query language (which as I mentioned is separate
from the wire protocol). The wire protocol does more than just wrap
queries though. It includes more complex interactions
COPY-ing data or asynchronous requests or
cancelling running requests.
In this post I did not evaluate the level of completeness of each database's implementation of the wire protocol. I only looked into what they'd do with basic queries. More could be done on evaluating the edge cases of the wire protocol in each implementation, in another post.
Let me know about your ideas, questions, corrections!
There's a wide world of databases implementing the Postgres wire protocol. Databases like @Yugabyte @TimescaleDB @cratedb @QuestDb @CockroachDB . But what does that mean? And where does the wire protcol end?— Multiprocess Labs (@multiprocessio) February 8, 2022
All this and more explored in a new blog posthttps://t.co/N4VnF2paCl pic.twitter.com/ypvsSXVeP5