2016-01-04 97 views

回答

1

根據http://www.h2database.com/html/advanced.html

...它支持PostgreSQL的網絡協議...支持PostgreSQL的網絡協議是相當新的,應該被視爲實驗性的。它不應該用於生產應用。

所以github.com/lib/pq驅動程序很有可能會使用h2。

+0

我希望性能將保持與pg驅動程序,因爲h2我喜歡性能 – Kaxa

+0

我試過postgres驅動程序,但不適用於h2 db,err:= sql.Open(「postgres」,「postgres:// sa:123 @ localhost:8082/test「) db,err:= sql.Open(」postgres「,」postgres:// sa:123 @ localhost:8082 /〜/ test「) – Kaxa

+0

文檔建議PG服務器使用不同的端口 - 5435.與5432 – kostya