Forum OpenACS Q&A: Response to Postgres Problem -again

Collapse
Posted by Grzegorz Mucha on
<p>Well, I do not edit the dump files - the only thing I do is running the postgres.sql script first, if I don't have the dual, sysdate plpgsql etc., then go with the dump file. The only encountered problems while loading it were with duplicating definitions already done in postgres.sql

<p>When I dropped the table I did it simply with
<pre>drop table ec_user_class_user_map</pre>
(I copied it into another table with SELECT), then reloaded with another select and added foreign keys:

<pre>ALTER TABLE ec_user_class_user_map ADD CONSTRAINT uid FOREIGN KEY (last_modifying_user) REFERENCES users(user_id);
ALTER TABLE ec_user_class_user_map ADD CONSTRAINT u_class_id FOREIGN KEY (user_class_id) REFERENCES ec_user_classes(user_class_id) ON DELETE CASCADE;
ALTER TABLE ec_user_class_user_map ADD CONSTRAINT uid2 FOREIGN KEY (user_id) REFERENCES users(user_id);</pre>
<p>After adding the above constraints, I can delete the records, AFAIR the only missing check is for the value of 'active_p' in ('t','f'). I have to check what about the ec_sale_prices, what are the FK's there
<p>Do you know if there are any RULEs referencing ec_user_class_user_map (or triggers, beside the audit one)?