Re: Query regarding deadlock

From: Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>
To: Yogesh Sharma <Yogesh1(dot)Sharma(at)nectechnologies(dot)in>, PostgreSQL General Discussion Forum <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query regarding deadlock
Date: 2016-11-25 02:14:26
Message-ID: CADp-Sm4wQorkbEjPGD1+VkUfpyakuttNqdvG3T-1HzJmRoqfFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 25 Nov 2016, 9:45 a.m. Yogesh Sharma, <
Yogesh1(dot)Sharma(at)nectechnologies(dot)in> wrote:

> Dear All,
>
> Thanks in advance.
> I found below deadlock in postgresql logs.
> I cannot change calling of REINDEX and insert query sequence because it is
> execute automatically through some cron script.
>

Does this mean that you reindex quite often based on a schedule. Personally
I don't prefer that. To me it is like you are trying to fix something that
is not broken.

Ideally reindex only what needs to be reindexed. I would not want to
reindex a table in OLTP env.

> ERROR: deadlock detected
> DETAIL: Process 2234 waits for AccessShareLock on relation 16459 of
> database 16385; blocked by process 4111.
> Process 4111 waits for ShareLock on relation 16502 of database 16385;
> blocked by process 2234.
> Process 2234: INSERT INTO table1 ( id , unique_id )VALUES( '1', '4')
> Process 4111: REINDEX TABLE table1
>

> Could you please provide any solution to resolve this deadlock.
>
> Regards,
> Yogesh
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
--

--

Best Regards,

*Sameer Kumar | DB Solution Architect*

*ASHNIK PTE. LTD.*

101 Cecil Street, #11-11 Tong Eng Building, Singapore 069533

T: +65 6438 3504 | www.ashnik.com

Skype: sameer.ashnik | T: +65 8110 0350

[image: www.ashnik.com] <http://www.ashnik.com/>​

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan de Visser 2016-11-25 02:17:09 Re: Query regarding deadlock
Previous Message Yogesh Sharma 2016-11-25 02:06:45 Re: Query regarding deadlock