环境:PGconn.connect ....在哪里断开连接?
PSQL(PostgreSQL的)9.6.3 导轨5.1.1 红宝石2.4.1p111
问题:
我可以具有一大群(设计)的用户每个人都是一个单独的Postgres用户,例如SomePostgresRole01,SomePostgresRole02等
我可以成功做到:
conn = PGconn.connect("localhost", 5432,"","","db_development","SomePostgresRole01","SomePassword")
我无法找到一个方法conn.disconnect。这种功能是否存在?
'conn.close' should work –
IIRC,你可以传递一个块,即'PG.connect(...){| conn | ...}并且连接将在之后自动关闭。 – Stefan