DigitalChinaOpenSource / TiDB-for-PostgreSQL

PgSQL compatible on distributed database TiDB
Apache License 2.0
387 stars 21 forks source link

Connect via socket #34

Closed AmoebaProtozoa closed 3 years ago

AmoebaProtozoa commented 3 years ago

Development Task

Description

Both MySQL TiDB and PostgreSQL support connecting via socket on Unix-like systems. This is even their default behavior when not specifying using TCP/IP as it’s more secure and modern. However, MySQL and PostgreSQL has different socket format. Namely, mysql.sock vs .s.PGSQL.nnnnwhere nnnn is the server’s port number.

Currently we have TiDB’s old method of generating mysql.sock file, we would like to replace it with one that comply with Postgres’ standard.

Which Module does this belong

Server module. This should be handled before/ along with handshake

Task List

References

https://dev.mysql.com/doc/refman/8.0/en/connection-options.html#option_general_socket https://www.postgresql.org/docs/9.3/runtime-config-connection.html