pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Terence Kearns <terencek@isd.canberra.edu.au>
To: pgsql-sql@postgresql.org
Subject: Re: (trigger function) -> ERROR: NEW used in non-rule query
Date: Fri, 18 Jul 2003 10:03:42 +0100
Message-ID: <200307181003.42279.dev@archonet.com> (raw)
In-Reply-To: <3F17AE38.5020302@cts.canberra.edu.au>
References: <3F17AE38.5020302@cts.canberra.edu.au>

On Friday 18 Jul 2003 9:22 am, Terence Kearns wrote:
> I'm writing a trigger which wants to reference the pre-defined NEW record.
>
> I can do this
> idval := NEW.blah;
>
> This works fine!!!
>
> What I really need to do is
> idval := NEW.(quote_ident(TG_ARGV[3]));
> or this
> idval := NEW.(TG_ARGV[3]);

I'll give you the short answer - no you can't do this (in plpgsql). Which 
isn't to say it'll never be possible, but not at the moment.

Can you afford to look at an alternative language? I'd suggest looking at TCL, 
although I must admit I've never used it myself.


-- 
  Richard Huxton



view thread (7+ messages)  latest in thread

Message-ID: <200307181003.42279.dev@archonet.com>
Permalink:  ../200307181003.42279.dev@archonet.com/
Also on:    postgresql.org/message-id/200307181003.42279.dev@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, terencek@isd.canberra.edu.au
  Subject: Re: (trigger function) -> ERROR: NEW used in non-rule query
  In-Reply-To: <200307181003.42279.dev@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox