From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: strange locks on PG 11 with Golang programs
Date: Wed, 11 Mar 2020 22:22:43 +0100
Message-ID: <20200311212243.GA15977@hjp.at> (raw)
In-Reply-To: <fbf5ed29-9787-2b71-57f9-91fcc8766e8b@matrix.gatewaynet.com>
References: <CAGvVEFuDvpFfiH6ja_jvf5u-GfhoLPEom+adWESwHEXfRjKdBQ@mail.gmail.com>
<fbf5ed29-9787-2b71-57f9-91fcc8766e8b@matrix.gatewaynet.com>
On 2020-03-09 11:02:37 +0200, Achilleas Mantzios wrote:
> Fully review your programs for connection / xaction leaks. Do you use a
> connection pool?
Go's sql package encourages the use of connection pools (type DB) over
single connections (type Conn):
| Prefer running queries from DB unless there is a specific need for a
| continuous single database connection.
All tutorials I've seen follow this recommendation, so a Go programmer
might not even be aware that connections exist.
hp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: hjp-pgsql@hjp.at
Subject: Re: strange locks on PG 11 with Golang programs
In-Reply-To: <20200311212243.GA15977@hjp.at>
References: <CAGvVEFuDvpFfiH6ja_jvf5u-GfhoLPEom+adWESwHEXfRjKdBQ@mail.gmail.com> <fbf5ed29-9787-2b71-57f9-91fcc8766e8b@matrix.gatewaynet.com> <20200311212243.GA15977@hjp.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox