Skip site navigation (1) Skip section navigation (2)

Help needed

From: NosyMan <nosyman(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Help needed
Date: 2005-11-30 09:18:28
Message-ID: 200511301118.28795.nosyman@gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
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

In response to

Responses

pgsql-sql by date

Next:From: Richard HuxtonDate: 2005-11-30 10:35:55
Subject: Re: Help needed
Previous:From: Jan WieckDate: 2005-11-29 23:25:02
Subject: Re: Triggers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group