Re: strange locks on PG 11 with Golang programs

From: Josef Machytka <josef(dot)machytka(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: strange locks on PG 11 with Golang programs
Date: 2020-03-09 09:21:23
Message-ID: CAGvVEFuPfVYLKJq=uzB_eLXfOwAjrM09HtVO5G6+6XcHi3hukQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 9 Mar 2020 at 09:58, Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:

> The query displayed is just the query currently executing, but if the
> connection is in a transaction the problematic lock could have been
> acquired by
> any previously executed query. Did you check in pg_stat_activity if the
> connection is in a transaction (e.g. query_start != xact_start)?
>

Oh, I see. Thank you. I modified query from wiki and it shows that blocking
session actually runs for ~12 hours already. Only last COPY command started
recently. So maybe golang library did not close session properly and reused
it in another completely different task? Although I defer db.Close()
everywhere...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Julien Rouhaud 2020-03-09 09:36:55 Re: strange locks on PG 11 with Golang programs
Previous Message Achilleas Mantzios 2020-03-09 09:02:37 Re: strange locks on PG 11 with Golang programs