{"id":49918,"library":"lib-pq","title":"lib/pq","description":"Go PostgreSQL driver for database/sql.","status":"active","version":"1.12.3","language":"go","source_language":null,"source_url":"https://github.com/lib/pq","tags":["postgresql","database","sql","driver"],"install":[{"cmd":"go get github.com/lib/pq","lang":"bash","label":"Install github.com/lib/pq"}],"dependencies":[],"imports":[{"symbol":"pq","correct":"github.com/lib/pq"}],"quickstart":{"code":"package main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t_ \"github.com/lib/pq\"\n)\n\nfunc main() {\n\tdb, err := sql.Open(\"postgres\", \"user=postgres dbname=test sslmode=disable\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer db.Close()\n\tvar version string\n\tdb.QueryRow(\"SELECT version()\").Scan(&version)\n\tfmt.Println(version)\n}","lang":"go","description":"Connects to PostgreSQL and queries the server version."},"warnings":[{"fix":"Use INSERT ... RETURNING id with QueryRow.","message":"pq does not support sql.Result.LastInsertId; use RETURNING clause instead.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'databas':8 'database/sql':6 'driver':4,10 'go':2 'lib/pq':1 'postgresql':3,7 'sql':9","created_at":"2026-06-15T04:32:56.847307+00:00","updated_at":"2026-06-15T04:32:56.847307+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/lib/pq","github":"https://github.com/lib/pq","docs":"https://pkg.go.dev/github.com/lib/pq#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}