在 postgres/mysql 中如何判断当前版本是多少
Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 213
Author 回答者: shfshanyue
使用 select version()
postgres 示例如下:
postgres@db:school> select version()
+---------------------------------------------------------------------------------------+
| version |
|---------------------------------------------------------------------------------------|
| PostgreSQL 12.1 on x86_64-pc-linux-musl, compiled by gcc (Alpine 8.3.0) 8.3.0, 64-bit |
+---------------------------------------------------------------------------------------+
SELECT 1
Time: 0.028s
mysql 示例如下:
> select version()
+-------------+
| version() |
|-------------|
| 5.6.16-log |
+-------------+
1 row in set
Time: 0.003s