pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: NosyMan <nosyman@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Help needed
Date: Wed, 30 Nov 2005 11:18:28 +0200
Message-ID: <200511301118.28795.nosyman@gmail.com> (raw)
In-Reply-To: <200511291747.49570.leif@solumslekt.org>
References: <200511291531.30441.leif@solumslekt.org>
	<200511291701.26148.leif@solumslekt.org>
	<200511291747.49570.leif@solumslekt.org>

Hi everyone,

I have some kind of strange problem. I want to build general parametrized 
trigger for my database. The parameter sent to the trigger contains a column 
name that trigger should be check.  

CREATE OR REPLACE FUNCTION F_T_IU__check() RETURNS trigger AS $$
	DECLARE
		vt VARCHAR;
	BEGIN
...........................................................
			vt:='constant_value_id';
			RAISE EXCEPTION 'aaa=%', NEW.vt;
.............................................................

The 'vt' variable contains the column name. In the above statement I want that 
NEW.vt to be interpreted as NEW.constant_value_id. It is possible to do this?

Thanks,
Nosy



view thread (4+ messages)  latest in thread

Message-ID: <200511301118.28795.nosyman@gmail.com>
Permalink:  ../200511301118.28795.nosyman@gmail.com/
Also on:    postgresql.org/message-id/200511301118.28795.nosyman@gmail.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: nosyman@gmail.com
  Subject: Re: Help needed
  In-Reply-To: <200511301118.28795.nosyman@gmail.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