[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[],[],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)."]]