Re: [GENERAL] adjusting primary key

2006-10-10 Thread Rafal Pietrak
Thenx a lot. That does it!! -R On Tue, 2006-10-10 at 16:23 +0200, [EMAIL PROTECTED] wrote: > You have to create t2 as following: > CREATE TABLE t2 (id int, grp int references t1(id) ON UPDATE CASCADE ON > DELETE CASCADE, info text); > > Through the cascade commands Postgresql will check the t2

Re: [GENERAL] adjusting primary key

2006-10-10 Thread Matthias . Pitzl
You have to create t2 as following: CREATE TABLE t2 (id int, grp int references t1(id) ON UPDATE CASCADE ON DELETE CASCADE, info text); Through the cascade commands Postgresql will check the t2 table on rows which have to be deleted or updated according to your changes in t1. For changing the exi

Re: [GENERAL] adjusting primary key

2006-10-10 Thread Alexander Staubo
On Oct 10, 2006, at 15:59 , Rafal Pietrak wrote: Hi All, I have two tables: CREATE TABLE t1 (id int not null unique, info text); CREATE TABLE t2 (id int, grp int references t1(id), info text); Now, at certain point (both tables populated with tousends of records, and continuesly referenced by

Re: [GENERAL] adjusting primary key

2006-10-10 Thread John Sidney-Woollett
If you could alter the foreign key constraint such that the update on t1's primary key cascaded to t2, that would help. However, I'm not sure that you alter the constraint in postgres once it's created. Hopefully someone more knowledgeable will be able to respond. John Rafal Pietrak wrote: