On 11/16/06, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> create rule "child_with_parent_explicit_insert" as
> on insert to child_with_parent_explicit do instead (
> insert into parent(id, foo) values(COALESCE
> (new.id,NEXTVAL('parent_id_seq')), new.foo);
> insert into child(id, bar) values(COALESCE
> (new.id,CURRVAL('parent_id_seq')), new.bar);
> );
>
>
> I'm not sure if this is what you're looking for, but does this help?
>
> Regards,
> Jeff Davis
>
>
COALESCE is certainly something I had never heard of. I think that will
solve my problem quite effectively. Thanks for your help!
Jeremy