[HN Gopher] New PostgreSQL Interface for Cloud Spanner
       ___________________________________________________________________
        
       New PostgreSQL Interface for Cloud Spanner
        
       Author : aleyan
       Score  : 43 points
       Date   : 2021-10-12 20:38 UTC (2 hours ago)
        
 (HTM) web link (cloud.google.com)
 (TXT) w3m dump (cloud.google.com)
        
       | the_duke wrote:
       | > the PostgreSQL interface implements a core subset of PostgreSQL
       | data types and DDL syntax.
       | 
       | > Familiarity and portability are the goals, not 100%
       | compatibility
       | 
       | So, is there a compatibility matrix?
       | 
       | 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.
       | 
       | But both of those do require a high level of conformance.
        
         | dudus wrote:
         | This page describes what is or isn't supported.
         | 
         | https://cloud.google.com/spanner/docs/postgresql/overview
        
       | slownews45 wrote:
       | Wow - I did NOT see this coming.
       | 
       | Crazy - and GREAT!
       | 
       | Cloud Spanner in my mind was always "cool" - but I never saw
       | myself understanding how to use it.
       | 
       | I think for folks bridging from something like postgresql, this
       | could also make spanner more accessible.
        
       | wmitty wrote:
       | The Cloud Spanner SQL frontend/analyzer has been open sourced by
       | google as ZetaSQL. https://github.com/google/zetasql
       | 
       | It is amazingly good.
       | 
       | 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.
       | 
       | Anyway, the big problem with ZetaSQL is that it is not a common
       | SQL dialect.
       | 
       | 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.
        
       | da39a3ee wrote:
       | 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)
        
         | dudus wrote:
         | They achieve the same goal, but cockroachDB usually relies on
         | the NTP and Spanner makes use of specialized clocks on Google
         | datacenter to be able to sync the multiple instances.
        
       | orf wrote:
       | Looks awesome! A few data types not yet supported:
       | https://cloud.google.com/spanner/docs/postgresql/data-types, like
       | interval or array, which is a shame.
       | 
       | 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.
       | 
       | Small, simple HTML doc pages that are fast to load please. Copy
       | how AWS does it.
        
       ___________________________________________________________________
       (page generated 2021-10-12 23:00 UTC)