DigitalChinaOpenSource / TiDB-for-PostgreSQL

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

Server: add Postgres socket connection capability #43

Closed AmoebaProtozoa closed 3 years ago

AmoebaProtozoa commented 3 years ago

Signed-off-by: David davidyangad@gmail.com

What problem does this PR solve?

Added PostgreSQL socket connection capability #34

What's Changed:

Now during server initiation, a socket file comply with Postgres standard will be created at the designated directory Old mysql socket file ("tidb.sock") will no longer be created

How it Works:

Just specify which directory you want put the socket file when starting the server, for example: go run tidb-server/main.go -socket /tmp The corresponding socket file will be created

When connect with Postgres client via socket, specify the same folder

Related changes

Added two new unit test for socket connection as well as socket forwarding

Tests

make check PASS make gotest PASS