Anthony Chavez <acc@anthonychavez.org> writes:
> What I've got here are a couple of ON INSERT rules for a view. The
> second rule is what I'm concerned about. I wrote it with PostgreSQL's
> ACID compliance in mind, but can I trust it?
Oops, forgot to mention two things:
1. The addresses_address_lines view assumes that a row already exists in the addresses relation because that relation
hassome NOT NULL attributes that lack defaults. Hence, there is no insert_addresses rule. I suppose I should create
one,but choosing a default value for some of the foreign keys in that relation would be difficult.
2. I have an AFTER INSERT trigger function on the addresses relation that inserts a default display_orderings tuple
(withordering = 0) and sets up the association in the junctions table. Hence the use of UPDATE in the
insert_display_orderingsrule.
Cheers!
--
Anthony Chavez http://anthonychavez.org/
mailto:acc@anthonychavez.org jabber:acc@jabber.anthonychavez.org