| From: | Richard Huxton <dev(at)archonet(dot)com> |
|---|---|
| To: | Joost Kraaijeveld <J(dot)Kraaijeveld(at)Askesis(dot)nl> |
| Cc: | Pgsql-General <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Is this a bug or am I doing something wrong? |
| Date: | 2005-09-09 12:25:30 |
| Message-ID: | 43217F3A.7080307@archonet.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Joost Kraaijeveld wrote:
> Hi,
>
> I am trying to create a foreign key, followed by creating anindex on the
> foreign key, using PgAdmin III
>
> The command that are generated :
>
> ALTER TABLE prototype.orderlines ADD CONSTRAINT fk_orderlines_orders
> FOREIGN KEY (orderobjectid) REFERENCES prototype.orders (objectid)
> ON UPDATE RESTRICT ON DELETE RESTRICT;
>
> CREATE INDEX fki_orderlines_orders ON
> prototype.orderlines(orderobjectid);
>
> Ont the second command PostgreSQL hangs forever. The
> prototype.orderlines table is completely empty, the prototype.orders
> table contains 1.000.000+ records.
Well, if orderlines is empty it shouldn't take long to create an index.
I'd suspect lock issues - see what's in the pg_locks view.
It's also worth trying these things in psql too - that way you know
exactly what is being executed.
--
Richard Huxton
Archonet Ltd
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Roman Neuhauser | 2005-09-09 12:35:34 | constraints on composite types |
| Previous Message | Roger Hand | 2005-09-09 12:14:56 | Re: Problem using NULLIF in a CASE expression |