Re: [ADMIN] Getting the OID of inserted row in a rule

2004-09-22 Thread Bradley Kieser
Ah! I didn't know that! Michael, thank you so much! No, I don't have anything sharing these sessions, they are rules in the back end so they should (unless someone tells me differently) AFAIK be in their own threads. Top man! Brad Michael Fuhr wrote: On Wed, Sep 22, 2004 at 04:30:06PM +0100, Bra

Re: [ADMIN] Getting the OID of inserted row in a rule

2004-09-22 Thread Gaetano Mendola
Bradley Kieser wrote: Hi Michael, But what if another insert happens in the mean time? Then the sequence would have advanced that the data will be scrambled. |Given that this could be a very active dataset, that situation is almost certain to occur. I think you are wrong, the sequence are not af

Re: [ADMIN] Getting the OID of inserted row in a rule

2004-09-22 Thread Michael Fuhr
On Wed, Sep 22, 2004 at 04:30:06PM +0100, Bradley Kieser wrote: > Michael Fuhr wrote: > > >CREATE RULE v_ins AS ON INSERT TO v DO INSTEAD ( > > INSERT INTO a (xxx) VALUES (NEW.xxx); > > INSERT INTO b (col1, col2, col3) VALUES (NEW.col1, NEW.col2, > > currval('a_id_seq')) > >); > > But what if ano

Re: [ADMIN] Getting the OID of inserted row in a rule

2004-09-22 Thread Bradley Kieser
Hi Michael, But what if another insert happens in the mean time? Then the sequence would have advanced that the data will be scrambled. |Given that this could be a very active dataset, that situation is almost certain to occur. Brad Michael Fuhr wrote: On Wed, Sep 22, 2004 at 02:21:42PM +0100, B

Re: [ADMIN] Getting the OID of inserted row in a rule

2004-09-22 Thread Michael Fuhr
On Wed, Sep 22, 2004 at 02:21:42PM +0100, Bradley Kieser wrote: > I have a rule on a view that needs to insert into two tables. The one > table has a serial ID as its unique key. The second table links to the > first one in one of its columns. > > I would prefer to keep this as a rule-based solu

[ADMIN] Getting the OID of inserted row in a rule

2004-09-22 Thread Bradley Kieser
I have a rule on a view that needs to insert into two tables. The one table has a serial ID as its unique key. The second table links to the first one in one of its columns. I would prefer to keep this as a rule-based solution and not have to write a function as I hope to relicate the solution