I have a rather small database(200Mb) which was running on ubuntu 10.10/amazon ec2 fine for a year almost but today I ran into the following problem: When I create a table that references other table like:
CREATE TABLE "limit" (
"id" serial NOT NULL PRIMARY KEY,
"currency_id" integer NOT NULL UNIQUE REFERENCES "currency" ("id")
DEFERRABLE INITIALLY DEFERRED,
"min_amount" numeric(10, 2) NOT NULL,
"max_amount" numeric(10, 2) NOT NULL
)
The thread hangs and blocks all other threads eventually,(but I can still terminate it with kill -INT) though the other table (currency) is rather small like 24 entries. Sources out there say that I should reindex my table but then again, running
REINDEX table currency
hangs forever. BTW creating the table without index, works like a charm. What can be the possible explanation and solution to this?
reindexproblem first. "Hangs forever" - using CPU? io?. Have you tried recreatingcurrency? btw postgres does not use threads - do you mean the process? Looks like a corruption issue to me - check filesystem etc for errors too. – Jack Douglas♦ Nov 26 '11 at 12:40