Choosing the Right Dialect for Your Spanner Database
Stay organized with collections
Save and categorize content based on your preferences.
When creating a Spanner database, you can choose between two SQL
dialects: GoogleSQL and PostgreSQL. Both dialects offer
the same core Spanner features, performance, and scalability.
Requirements of applications, developers, and the ecosystem in which you work
should inform your choice of dialect. This page lists the deciding factors
between using GoogleSQL and PostgreSQL interface
dialect databases.
Key Considerations:
Portability: if you choose PostgreSQL, you have the option of
migrating from Spanner to another PostgreSQL
database.
Familiarity: if your team is already familiar with either
PostgreSQL or GoogleSQL syntax and tools, choosing
that dialect can streamline development and reduce the learning curve.
Ecosystem: consider the tools and libraries available for each dialect.
GoogleSQL is well-integrated with Google Cloud services,
while PostgreSQL has a vast open-source ecosystem.
Application requirements: assess your application's specific
requirements regarding SQL syntax, data types, and potential future needs.
Migration: if you are migrating from an existing database, choosing the
dialect closer to your current environment might simplify the migration
process.
If portability is your highest priority, giving you the option to move away from Google Cloud, choose PostgreSQL. If you want the tightest
integration with Google Cloud (for example, to use BigQuery),
then choose GoogleSQL.
Spanner implementation of GoogleSQL and the
PostgreSQL interface:
Feature parity: Both GoogleSQL and PostgreSQL
dialects provide equivalent support for Spanner's unique
features, such as interleaved tables and query hints.
Underlying engine: Both dialects share the same underlying distributed
storage and query processing engine, ensuring consistent performance,
scalability, and reliability.
Management and development: You can manage and develop applications for
both dialects using the same Spanner tools, APIs, and client
libraries.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Choosing the Right Dialect for Your Spanner Database\n\nWhen creating a Spanner database, you can choose between two SQL\ndialects: GoogleSQL and PostgreSQL. Both dialects offer\nthe same core Spanner features, performance, and scalability.\nRequirements of applications, developers, and the ecosystem in which you work\nshould inform your choice of dialect. This page lists the deciding factors\nbetween using GoogleSQL and PostgreSQL interface\ndialect databases.\n\n**Key Considerations:**\n\n- **Portability**: if you choose PostgreSQL, you have the option of migrating from Spanner to another PostgreSQL database.\n- **Familiarity:** if your team is already familiar with either PostgreSQL or GoogleSQL syntax and tools, choosing that dialect can streamline development and reduce the learning curve.\n- **Ecosystem:** consider the tools and libraries available for each dialect. GoogleSQL is well-integrated with Google Cloud services, while PostgreSQL has a vast open-source ecosystem.\n- **Application requirements:** assess your application's specific requirements regarding SQL syntax, data types, and potential future needs.\n- **Migration:** if you are migrating from an existing database, choosing the dialect closer to your current environment might simplify the migration process.\n\nIf portability is your highest priority, giving you the option to move away from Google Cloud, choose PostgreSQL. If you want the tightest\nintegration with Google Cloud (for example, to use BigQuery),\nthen choose GoogleSQL.\n\n**Spanner implementation of GoogleSQL and the\nPostgreSQL interface:**\n\n- **Feature parity:** Both GoogleSQL and PostgreSQL dialects provide equivalent support for Spanner's unique features, such as interleaved tables and query hints.\n- **Underlying engine:** Both dialects share the same underlying distributed storage and query processing engine, ensuring consistent performance, scalability, and reliability.\n- **Management and development:** You can manage and develop applications for both dialects using the same Spanner tools, APIs, and client libraries.\n\nWhat's next\n-----------\n\n- Learn about [dialect parity between GoogleSQL and\n PostgreSQL](/spanner/docs/reference/dialect-differences)."]]