Nis Jørgensen skrev:
>
> What is missing above is creating INSERT/UPDATE/DELETE rules for the
> "entity" view.  I hacked together the ones below - they seem to work,
> but there might be subtle points of how this works that I have not
> understood.
>   
[...]

> CREATE RULE entity_insert as ON INSERT TO entity DO INSTEAD (
>     INSERT INTO entity_base (f1,f2,f3,f4,f5,f6,f7) VALUES (NEW.f1,
> NEW.f2, NEW.f3, NEW.f4, NEW.f5, NEW.f6, NEW.f7);
>   INSERT INTO  entity_idx VALUES (currval('entity_base_id_seq'::regclass))
> );
>   
The naive approach for inserting the new id's didn't work - it tries to
insert the same value into all rows. If I use NEW.id instead, new
sequence values are generated for the entity_idx table.

It seems like this is (or at least was) a known limitation:

http://archives.postgresql.org/pgsql-bugs/2004-07/msg00209.php

Nis





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to