URGENET: ALTER statement exectuation hangs when it is executed multiple time on a table - Mailing list pgsql-interfaces

From Dennis Wang
Subject URGENET: ALTER statement exectuation hangs when it is executed multiple time on a table
Date
Msg-id BAY137-W832842CAB356C78B3C728D64B0@phx.gbl
Whole thread Raw
Responses Re: URGENET: ALTER statement exectuation hangs when it is executed multiple time on a table  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
I am using a shell script to copy some table records into PostgreSQL database. The logic steps are: 1. set default
valuefor table id 2. load some large records into the table 3. drop the id definition 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.
rerunthe shell script to copy records. 
Then, the ALTER statement in step 1 hanging there. I did check the lock state of the warngrid table, it says the
processcreated by the ALTER statement hold an "AccessExclusiveLock" on the table.  
I wonder if PostgreSQL got some internal mechanism which prevent a table id field being altered many times when there
aresome pre-existed records in the table? or something in PostgreSQL that I am not aware of cause the problem.  
Thanks for the help!
Dennis
_________________________________________________________________
What are you waiting for? Join Lavalife FREE

http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Flavalife9%2Eninemsn%2Ecom%2Eau%2Fclickthru%2Fclickthru%2Eact%3Fid%3Dninemsn%26context%3Dan99%26locale%3Den%5FAU%26a%3D30288&_t=764581033&_r=email_taglines_Join_free_OCT07&_m=EXT

pgsql-interfaces by date:

Previous
From: Jeff Davis
Date:
Subject: new ruby-pg release: support for ruby 1.9
Next
From: Tom Lane
Date:
Subject: Re: URGENET: ALTER statement exectuation hangs when it is executed multiple time on a table