Search Postgresql Archives

Re: Is this a bug or am I doing something wrong?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux