Re: plpgsql and triggers
| От | Michael Fuhr | 
|---|---|
| Тема | Re: plpgsql and triggers | 
| Дата | |
| Msg-id | 20050606023048.GA92417@winnie.fuhr.org обсуждение исходный текст  | 
		
| Ответ на | plpgsql and triggers ("Bart Degryse" <Bart.Degryse@indicator.be>) | 
| Список | pgsql-sql | 
On Thu, Jun 02, 2005 at 01:57:26PM +0200, Bart Degryse wrote: > > I'm looking for a way to use a parameter given to a trigger function as > fieldname. It should be something like > create function f_makeupper() returns trigger as ' > begin > NEW.TG_ARGV[0] := upper(NEW.TG_ARGV[0]); > RETURN NEW; > end; > ' language 'plpgsql'; As you've discovered, this doesn't work in PL/pgSQL: the above code references the new row's TG_ARGV column, which doesn't exist. This comes up frequently; see the list archives for past discussion. The usual advice is to use a language like PL/Perl, PL/Tcl, PL/Python, etc. that provides this capability. -- Michael Fuhr http://www.fuhr.org/~mfuhr/
В списке pgsql-sql по дате отправления: