Re: Insert query hangs - Mailing list pgsql-general

From Greg Stark
Subject Re: Insert query hangs
Date
Msg-id CAM-w4HOa7ABvq=ncTuwP_nxZpYFHrSHOzoPh2ODKiMB-ym1S2g@mail.gmail.com
Whole thread Raw
In response to Re: Insert query hangs  (M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>)
List pgsql-general
On Wed, Jul 9, 2014 at 1:25 PM, M Tarkeshwar Rao
<m.tarkeshwar.rao@ericsson.com> wrote:
>
> I am sharing the table structure. When we removed the unique index it is working fine.
> And when created normal index(not unique) it is working fine.
>
> After removing unique index we tried to recreate it but it is giving following infinite logs :
>
> concurrent insert in progress within table "eventlogentry"
>
> caveat when building a unique index concurrently is that the uniqueness constraint

Hum, that is interesting.

So to sum up, your database works fine as long as the index isn't
present but you want to enforce this unique constraint. What version
of Postgres is this precisely (9.1.what?) Has it ever been upgraded
using pg_upgrade? Has it suffered a crash or been restored from
backups? What of Adrian Klaver's question about the database being
copied?

When you run create index you get this error? Please paste the actual
command and actual error messages. It should contain more information
than that. Try doing it with this set first:
 \set VERBOSITY 'verbose'

When you're getting these errors please run select * from
pg_stat_activity and paste that information -- remove any confidential
information but leave any INSERT, UPDATE, DELETEs on the table you're
indexing with just the confidential data removed.

Also, I don't think this is right but perhaps it could be a prepared
transaction? Try "select * from pg_prepared_xacts"?

If it's really corruption --which still seems a bit odd to me-- You
might find a simple vacuum or vacuum freeze on the table fixes up the
problem.

--
greg


pgsql-general by date:

Previous
From: "Edson F. Lidorio"
Date:
Subject: Download Postgresql 9.4 beta for Windows is not available.
Next
From: Adrian Klaver
Date:
Subject: Re: Download Postgresql 9.4 beta for Windows is not available.