[GENERAL] boolean short-circuiting in plpgsql

2008-07-31 Thread Kev
Hi everyone, I may be missing something obvious, but it seems like the advice in 4.2.12 on http://www.postgresql.org/docs/8.3/interactive/sql-expressions.html doesn't seem to apply in plpgsql. I have a table that I want to use a trigger on when either a new row is inserted or at least one of two

Re: [GENERAL] boolean short-circuiting in plpgsql

2008-07-31 Thread Tom Lane
Kev [EMAIL PROTECTED] writes: ...because the case should force it to only evaluate 'old' when TG_OP = 'UPDATE' and otherwise ('INSERT') skip through to 't'. But this causes the same error on insert. I suspect it's because the select query gets parameterized and at that point the 'old' is

Re: [GENERAL] boolean short-circuiting in plpgsql

2008-07-31 Thread Kevin Field
Kev [EMAIL PROTECTED] writes: ...because the case should force it to only evaluate 'old' when TG_OP = 'UPDATE' and otherwise ('INSERT') skip through to 't'. But this causes the same error on insert. I suspect it's because the select query gets parameterized and at that point the