IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Trying it now
It's got a foreign key reference to an item in the same table, which appears to be what you're after.

That's exactly what I'm looking for. Will try it now.
===
Microsoft offers them the one thing most business people will pay any price for - the ability to say "we had no choice - everyone's doing it that way." -- [link|http://z.iwethey.org/forums/render/content/show?contentid=38978|Andrew Grygus]
New Here's the problem
CREATE TABLE "menu_tbl" (\n   "menu_id" varchar(20) NOT NULL,\n   "menu_text" varchar(25) NOT NULL,\n   "menu_url" varchar(50) NOT NULL,\n   "menu_parent" varchar(20) REFERENCES menu_tbl(menu_id) ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,\n   CONSTRAINT "menu_tbl_pkey" PRIMARY KEY ("menu_id")\n);\n

Problem is, when I try to update "menu_id" when there is a matching "menu_parent" I get
ERROR:  referential integrity violation - key referenced from menu_tbl not found in menu_tbl

So I can get the foreign key working, but I can't get it to cascade the updates.
===
Microsoft offers them the one thing most business people will pay any price for - the ability to say "we had no choice - everyone's doing it that way." -- [link|http://z.iwethey.org/forums/render/content/show?contentid=38978|Andrew Grygus]
New And the solution
I need to explicitly begin a transaction before issuing the update command and commit after.
===
Microsoft offers them the one thing most business people will pay any price for - the ability to say "we had no choice - everyone's doing it that way." -- [link|http://z.iwethey.org/forums/render/content/show?contentid=38978|Andrew Grygus]
     Need examples for pl/pgsql - (drewk) - (4)
         Try this... - (Yendor) - (3)
             Trying it now - (drewk) - (2)
                 Here's the problem - (drewk) - (1)
                     And the solution - (drewk)

Bestowing a cruddy-green patina to this over-polished line of deductive reasoning.
62 ms