Re: ON INSERT view rule
От | Anthony Chavez |
---|---|
Тема | Re: ON INSERT view rule |
Дата | |
Msg-id | m2odvwfgg0.fsf@pegasos.aegaeum.anthonychavez.org обсуждение исходный текст |
Ответ на | ON INSERT view rule (Anthony Chavez <acc@anthonychavez.org>) |
Список | pgsql-sql |
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
В списке pgsql-sql по дате отправления: