Re: Query regarding deadlock

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Yogesh Sharma <Yogesh1(dot)Sharma(at)nectechnologies(dot)in>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query regarding deadlock
Date: 2016-11-25 04:45:02
Message-ID: 16822.1480049102@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yogesh Sharma <Yogesh1(dot)Sharma(at)nectechnologies(dot)in> writes:
> 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

Offhand I would not expect those two commands to deadlock in isolation.
Are they parts of larger transactions that take additional locks?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Juliano 2016-11-25 11:03:58 Re: Import data from MS SQL Server 2014 to Postgresql 9.6 using dbi-link and fdw (error: utf-8/uft-16)
Previous Message Sameer Kumar 2016-11-25 02:24:05 Re: Query regarding deadlock