Re: [GENERAL] Trigger not working as expected, first row gets a null value

2007-08-14 Thread novnov
Thanks, triggers are new turf for me so nothing is quite obvious. I thought, the after insert change is snuck in after the rec is created and via some built in behavior allows mods to the rec without triggering a cascade. But the reality makes sense and of course I can adjust my work to handle in

Re: [GENERAL] Trigger not working as expected, first row gets a null value

2007-08-14 Thread Tom Lane
novnov <[EMAIL PROTECTED]> writes: > The function is meant to find a value via the internal sql, and then update > a column in the same tabled that invoked the trigger with that value. Is > that a non-workable scenario? IE, an after insert trigger can't modify a > column in the same table that was

Re: [GENERAL] Trigger not working as expected, first row gets a null value

2007-08-14 Thread novnov
I have been able to spend some more time working on this and have made a bit of progress. I had the trigger set to run before insert; and the sql inside the trigger needed to ref the new record in order to supply a value. I think that's why the first try always applied a null value. So I've chan

Re: [GENERAL] Trigger not working as expected, first row gets a null value

2007-08-08 Thread Martijn van Oosterhout
On Wed, Aug 08, 2007 at 03:20:00PM -0700, novnov wrote: > > I know that would be best but it'd be a major undertaking to try to repro > this situation. I was hoping for some hints, 'it sounds like xyz', because > I'm pretty sure I'm just tripping over a commonplace issue. It doesn't have to be re

Re: [GENERAL] Trigger not working as expected, first row gets a null value

2007-08-08 Thread novnov
I know that would be best but it'd be a major undertaking to try to repro this situation. I was hoping for some hints, 'it sounds like xyz', because I'm pretty sure I'm just tripping over a commonplace issue. Rodrigo De León-2 wrote: > > On Aug 8, 3:20 pm, [EMAIL PROTECTED] (novnov) wrote: >> .

Re: [GENERAL] Trigger not working as expected, first row gets a null value

2007-08-08 Thread Rodrigo De León
On Aug 8, 3:20 pm, [EMAIL PROTECTED] (novnov) wrote: > ... I also don't understand ... DDL + sample data, please... ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/