pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dennis Wang <dennis_02_2002@hotmail.com>
Cc: Postgresql Help <pgsql-interfaces@postgresql.org>
Subject: Re: URGENET: ALTER statement exectuation hangs when it is executed multiple time on a table
Date: Thu, 10 Jan 2008 20:09:58 -0500
Message-ID: <20042.1200013798@sss.pgh.pa.us> (raw)
In-Reply-To: <BAY137-W832842CAB356C78B3C728D64B0@phx.gbl>
References: <BAY137-W832842CAB356C78B3C728D64B0@phx.gbl>

Dennis Wang <dennis_02_2002@hotmail.com> writes:
>   The actual PostgreSQL commands are:
>      ALTER TABLE warngrid ALTER COLUMN id SET DEFAULT (nextval('warngrid_seq')* 10)+1;
>      COPY warngrid FROM 'warngrid.csv' CSV HEADER; 
>      ALTER TABLE warngrid ALTER COLUMN id DROP DEFAULT;
 
> For the first time, these operation execute fine.  Then I do these steps:
>   4. delete all the records in the table
>   5. rerun the shell script to copy records.
 
> Then, the ALTER statement in step 1 hanging there.

Did you do all this in one database session, or more than one?  If the
latter, maybe you haven't committed the transaction that did the DELETE?

> I did check the lock state of the warngrid table, it says the process created by the ALTER statement hold an "AccessExclusiveLock" on the table. 

Did it actually *have* that lock, or was it waiting for it (granted = f
in pg_locks)?

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <20042.1200013798@sss.pgh.pa.us>
Permalink:  ../20042.1200013798@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20042.1200013798@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dennis_02_2002@hotmail.com
  Subject: Re: URGENET: ALTER statement exectuation hangs when it is executed multiple time on a table
  In-Reply-To: <20042.1200013798@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox