probelm with alter table add constraint......

From: roopasatish <roopabenzer(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: probelm with alter table add constraint......
Date: 2009-04-06 06:54:33
Message-ID: 5da3d2700904052354g61f02031x822322e9ee512ad9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I have an issue with the add foreign key constraint which goes for waiting
and locks other queries as well.

ALTER TABLE ONLY holding_positions ADD CONSTRAINT
holding_positions_stock_id_fkey FOREIGN KEY (stock_id)
REFERENCES stocks (stock_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION;

The holding_positions table has no data in it as yet.

ps aux | grep postgres
postgres 5855 0.8 1.6 346436 271452 ? Ss 16:34 0:07
postgres: abc stocks 192.100.100.111(60308) SELECT waiting
postgres 6134 0.0 0.0 346008 4184 ? Ss 16:44 0:00
postgres: xyz stocks 192.100.100.222(34604) ALTER TABLE waiting

Any suggestions would be appreciated.

Roopa

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Heikki Linnakangas 2009-04-06 08:26:50 Re: Best replication solution?
Previous Message Rainer Mager 2009-04-06 03:35:36 Re: difficulties with time based queries