Search Postgresql Archives

Re: strange locks on PG 11 with Golang programs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 09, 2020 at 10:21:23AM +0100, Josef Machytka wrote:
> On Mon, 9 Mar 2020 at 09:58, Julien Rouhaud <rjuju123@xxxxxxxxx> 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...

I don't know anything about golang libraries, but this sounds like a problem of
a simulated non-autocommit mode in the driver/lib.  You should look at
transaction handling with the lib you're using.





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux