Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiDB是否有计划支持PostgreSQL协议?
[Problem Scenario Involved]
A Stack Overflow survey in May 2023 showed that PostgreSQL has surpassed MySQL as the preferred database for developers, with 45.55% of respondents using PostgreSQL, compared to 41.09% for MySQL and 30.9% for SQLite.
[Expected Requirement Behavior]
TiDB supports the PostgreSQL protocol.
[Alternative Solutions for the Requirement]
[Background Information]
Uh, probably not. If you need a domestic database that supports the PostgreSQL protocol, you can use GaussDB or PolarDB.
Watching the trend, haha.
Although GaussDB or PolarDB support PG, the HTAP feature of TiDB supported by TiFlash is still unmatched by other databases 
There has been TiDB supporting the PG protocol for a long time, but not many people have paid attention to it. If you have any needs, contact @hey-hoho for guidance. 
Even if TiDB supports more computational factors than PG, if the syntax is incompatible, existing PG users will still face certain migration costs. Of course, whether to support PG or not depends on PingCAP’s overall strategy. Here is a comparison of features of mainstream distributed databases for reference.
The time service of OB is actually also centralized TSO;
CockroachDB’s storage engine has been switched to a self-developed storage engine written in Go.
After implementing some of the expected features of TiDB for PostgreSQL, we have basically verified the feasibility of the direction. However, there is still a lot of work to be done in the future. Even though there are various open-source distributed databases available now, we still believe that TiDB for PostgreSQL is a very good idea. Therefore, after implementing the basic protocol and completing the Sysbench test, we are also very eager to have the community’s support to verify the current test results and discuss the technical aspects and requirements of this project direction together. Embracing open source has always been our persistent effort. Since the end of 2020, we have been integrating into the TiDB ecosystem community and providing continuous support to the community. Not only do we contribute code to TiDB on GitHub, but we also solve related problems on platforms like asktug, showcasing our capabilities in TiDB development and implementation.
Thank you for the correction. Strictly speaking, OB should be considered a centralized structure. However, OB’s GTS is tenant-level, and it uses an OBServer integrated storage-compute architecture, which is more distributed compared to TiDB’s independent PD architecture. Additionally, OB only takes a timestamp at transaction commit, whereas TiDB takes timestamps twice, at the beginning and at the commit of the transaction.
Although Stack Overflow shows that PostgreSQL is used more, it is still rarely used in China. It is estimated that its popularity in China would need to reach the level of MySQL before it gets support.
Our TiDB is an international open-source product 
In China, it would be better to be like OceanBase and be compatible with multiple Oracle versions. Many systems in the financial industry are based on Oracle as the underlying database. Currently, OceanBase is almost monopolizing this field (even though it is very poor, lacks many features, and is not suitable for many business scenarios, it is compatible with Oracle).
If you want to gain a share in the information technology innovation industry, compatibility with Oracle would be a huge advantage. GaussDB is also compatible with Oracle, but it may not be as highly compatible as OB.
I have to say, for central state-owned enterprises, going O is now a top priority, so Huawei GaussDB, Tencent Tbase, and Alibaba PolarDB are among the candidates.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.