Re: Access dynamic NEW.column_name in trigger?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Nick <nboutelier(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Access dynamic NEW.column_name in trigger?
Date: 2009-10-10 07:40:26
Message-ID: dcc563d10910100040q714f37ebmdf9b4743f1f2ad6e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 9, 2009 at 8:23 PM, Nick <nboutelier(at)gmail(dot)com> wrote:
> This is a very abbr version of my problem, but what would be the best
> way to do this...
>
> DECLARE
>  column_name_var TEXT;
> BEGIN
>  RETURN NEW.column_name_var;
> END;

plpgsql doesn't really do dynamic column names. You'll need to
implement it in C, perl, or tcl really.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2009-10-10 10:12:00 Re: automated row deletion
Previous Message Mike Diehl 2009-10-10 06:54:47 Re: Stuck vacuum...