Steve Crawford wrote:
>
> I want to monitor inserts to table "foo":
> guid: integer not null default nextval('public.guid'::text)
> end_time: integer
[snip]
> I expected the guid to match. Unfortunately there are no matching
> guids between the two tables. It appears that the sequence is being
> called twice so the guid in the log table is one greater than the
> guid in the main table.
>
> Did I miss something in my rule logic or is this a bug?
Rules are simply macros, so you are right and the sequence will be
accessed twice. You'll want to look at triggers.
--
Richard Huxton
Archonet Ltd