TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

New PostgreSQL Interface for Cloud Spanner

201 pointsby aleyanover 3 years ago

11 comments

wmittyover 3 years ago
The Cloud Spanner SQL frontend&#x2F;analyzer has been open sourced by google as ZetaSQL. <a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;zetasql" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;zetasql</a><p>It is amazingly good.<p>You give it textual SQL (+ schema + all your function definitions) and it returns a really clean logical query plan. It is also happy to do this via a protobufs so you can use it from languages other than C++. It is also tested and documented up the wazoo. It has been such a pleasure to work with.<p>Anyway, the big problem with ZetaSQL is that it is not a common SQL dialect.<p>It seems that the only reasonable way to do this PostgreSQL interface for Cloud Spanner is to add a second parser (and other extensions) to ZetaSQL. If I am correct, I really really hope they open source that part of ZetaSQL as well - it would be a massive step forward for open source SQL tooling.
评论 #28846187 未加载
orfover 3 years ago
Looks awesome! A few data types not yet supported: <a href="https:&#x2F;&#x2F;cloud.google.com&#x2F;spanner&#x2F;docs&#x2F;postgresql&#x2F;data-types" rel="nofollow">https:&#x2F;&#x2F;cloud.google.com&#x2F;spanner&#x2F;docs&#x2F;postgresql&#x2F;data-types</a>, like interval or array, which is a shame.<p>Is just like to mention how awful the Google cloud docs are on a slow connection. Each link does some weird SPA bullshit that seems to take way too long, and you seem to often end up in an inconsistent state where refreshing the page takes you to a completely different article. Then pressing back seems to re-load the current page you are on whilst it does more SPA bullshit.<p>Small, simple HTML doc pages that are fast to load please. Copy how AWS does it.
评论 #28847070 未加载
ttulover 3 years ago
Back in the dinosaur age, I built a WiFi hotspot billing system using PostgreSQL. MySQL had a larger following, but was less reliable and lacked transactions. PostgreSQL was a competitor to Oracle, which was seen as the undisputed leader for large-scale databases containing mission-critical business data.<p>Fast-forward to 2021 and I am not surprised at all that PostgreSQL now seems to be taking over everywhere. The ethic of the PostgreSQL team seems to revolve around correctness and reliability rather than features and speed. I congratulate the team for sticking to their mettle all these years and achieving such success.
评论 #28847505 未加载
评论 #28848407 未加载
the_dukeover 3 years ago
&gt; the PostgreSQL interface implements a core subset of PostgreSQL data types and DDL syntax.<p>&gt; Familiarity and portability are the goals, not 100% compatibility<p>So, is there a compatibility matrix?<p>In general I see this as a good thing. It allows using Spanner without requiring a big rewrite should one want to migrate away from GC. Or using Spanner as a secondary data warehouse with the same queries.<p>But both of those do require a high level of conformance.
评论 #28846129 未加载
slownews45over 3 years ago
Wow - I did NOT see this coming.<p>Crazy - and GREAT!<p>Cloud Spanner in my mind was always &quot;cool&quot; - but I never saw myself understanding how to use it.<p>I think for folks bridging from something like postgresql, this could also make spanner more accessible.<p>My own use cases can all be handled so simply with postgresql I don&#x27;t see needing the spanner scale, but for others perhaps valuable.
评论 #28846626 未加载
da39a3eeover 3 years ago
Is anyone able to comment on the extent to which Cloud Spanner and CockroachDB are in competition with each other? (CockroachDB is also wire-compatible with Postgres and originates as an implementation of something similar to Spanner)
评论 #28846340 未加载
评论 #28846208 未加载
评论 #28846154 未加载
评论 #28847771 未加载
Diggseyover 3 years ago
Spanner, CockroachDB and similar are really exciting, but the fact that none of them support stored procedures begs the question of whether it&#x27;s inherently hard&#x2F;impossible to do so in a distributed database, or whether that just hasn&#x27;t been a priority...
评论 #28847119 未加载
评论 #28847321 未加载
评论 #28849673 未加载
sciurusover 3 years ago
&gt; To enable PostgreSQL tools that don’t know anything about Spanner, the PostgreSQL interface also includes an open-source adapter that runs as a sidecar proxy, close to a client.<p>I wonder why they decided to do this instead of building a postgres-compatible endpoint into the spanner service itself.
ralusekover 3 years ago
This is awesome, but what are the limitations? Unless I can use it with ORMs that I already tend to depend on (like Sequelize), it&#x27;s probably a no-go. And I&#x27;m assuming no joins, or very limited left joins?
thorumover 3 years ago
That’s very cool. Does anyone know if there is a good list of other databases that include a PostgreSQL interface?
bigbizisverywyzover 3 years ago
I&#x27;m surprised people are applauding this. The net result of this support (and cockroach&#x27;s) is that it will take mindshare <i>away</i> from Postgres which has worked hard for decades to build a loyal fanbase.<p>It&#x27;s also step 1 of the e.e.e playbook, not that I&#x27;m suggesting Google want to extinguish Postgres, but it&#x27;s clearly aimed at building their market share at the expense of Postgres&#x27;s.