Re: Is this a bug or am I doing something wrong? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Is this a bug or am I doing something wrong?
Date
Msg-id 43217F3A.7080307@archonet.com
Whole thread Raw
In response to Is this a bug or am I doing something wrong?  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
Responses Re: Is this a bug or am I doing something wrong?
List 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

pgsql-general by date:

Previous
From: "Roger Hand"
Date:
Subject: Re: Problem using NULLIF in a CASE expression
Next
From: Roman Neuhauser
Date:
Subject: constraints on composite types