Anthony Chavez <[EMAIL PROTECTED]> 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 has some 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 (with ordering = 0)
   and sets up the association in the junctions table.  Hence the use
   of UPDATE in the insert_display_orderings rule.

Cheers!

-- 
Anthony Chavez                                 http://anthonychavez.org/
mailto:[EMAIL PROTECTED]         jabber:[EMAIL PROTECTED]

Attachment: pgp83LIixWmPl.pgp
Description: PGP signature

Reply via email to