Re: [GENERAL] Row insertion w/ trigger to another table update causes row insertion to _not_ occur

2009-07-21 Thread Ow Mun Heng
-Original Message-
From: gsst...@gmail.com [mailto:gsst...@gmail.com] On Behalf Of Greg Stark
 On Tue, Jul 21, 2009 at 11:25 PM, Ow Mun Hengow.mun.h...@wdc.com wrote:
    RETURN NULL;


 From the docs:
 It can return NULL to skip the operation for the current row.
 -- http://www.postgresql.org/docs/current/static/trigger-definition.html

 Just make your trigger return NEW and it won't kill the insert to the
 child table.

Dang it.. I just re-read the online docs this morning and I missed it. 
Then again, since I'm new to triggers, I may have mis-interpreted that.

Thanks for it. I'll give it a go.

 

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Row insertion w/ trigger to another table update causes row insertion to _not_ occur

2009-07-21 Thread Sim Zacks




Ow Mun Heng wrote:


  -Original Message-
From: gsst...@gmail.com [mailto:gsst...@gmail.com] On Behalf Of Greg Stark
  
  

  On Tue, Jul 21, 2009 at 11:25 PM, Ow Mun Hengow.mun.h...@wdc.com wrote:
 RETURN NULL;
  

  
  
Just make your trigger return NEW and it won't kill the insert to the
child table.

  
  
Dang it.. I just re-read the online docs this morning and I missed it. 
Then again, since I'm new to triggers, I may have mis-interpreted that.

Thanks for it. I'll give it a go.

I agree that is certainly one problem, but in any case an After Update
trigger would have worked.




Re: [GENERAL] Row insertion w/ trigger to another table update causes row insertion to _not_ occur

2009-07-21 Thread Ow Mun Heng


 From: Sim Zacks [mailto:s...@compulab.co.il] 

-Original Message-
From: gsst...@gmail.com [mailto:gsst...@gmail.com] On Behalf Of Greg Stark
  
On Tue, Jul 21, 2009 at 11:25 PM, Ow Mun Hengow.mun.h...@wdc.com wrote:
   RETURN NULL;
  
Just make your trigger return NEW and it won't kill the insert to the
child table.

I agree that is certainly one problem, but in any case an After Update
trigger would have worked.

I actually did try that, it didn't work. (I thought I mentioned that in the
original email. Oh well..)

Have yet to try the NEW method though

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general