Re: [SQL] Way to stop recursion?

2004-11-26 Thread Jonathan Knopp
Pierre-Frédéric Caillaud wrote: - Change the name of your table to "hidden_table" - Create a view which is a duplicate of your table : CREATE VIEW visible_table AS SELECT * FROM hidden_table; -> Your application now accesses its data without realizing it goes through a view. Now create a rule on

Re: [SQL] Way to stop recursion?

2004-11-26 Thread Jonathan Knopp
Tom Lane wrote: CREATE TABLE parent (id INT, cola CHAR(1), common CHAR(1)); CREATE TABLE child (id INT, parent_id INT, cola(1), common(1)); What I need, is when "common" is changed for a parent, then that new value is reflected in "common" for all the children, ie: ... Problem is, when "common" i

[SQL] Way to stop recursion?

2004-11-26 Thread Jonathan Knopp
Been banging my head against the wall for days and starting to think there is no way to do what I need. Hoping someone on here can prove me wrong. UPDATE rules work perfectly for what I need to do except I need them to only run once, not try and recurse (which of course isn't allowedby postgre