Trigger function languages

Started by Bruce Momjianalmost 26 years ago5 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

From the CREATE TRIGGER, it seems to say that only C functions are
supported by triggers. I see in the plpgsql manuals that it supports
triggers too.

What function languages do triggers support? C, plpgsql, pltcl, SQL?

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#2ts
decoux@moulon.inra.fr
In reply to: Bruce Momjian (#1)
Re: Trigger function languages

"B" == Bruce Momjian <pgman@candle.pha.pa.us> writes:

B> What function languages do triggers support? C, plpgsql, pltcl, SQL?

You can add plruby.

Ruby is the interpreted scripting language for quick and easy
object-oriented programming. It has many features to process text files and
to do system management tasks (as in Perl). It is simple, straight-forward,
extensible, and portable.

http://www.ruby-lang.org/en/

plruby can be found at

http://www.ruby-lang.org/en/raa-list.rhtml?name=PL%2FRuby

Guy Decoux

#3Hannu Krosing
hannu@tm.ee
In reply to: ts (#2)
Re: Trigger function languages

ts wrote:

"B" == Bruce Momjian <pgman@candle.pha.pa.us> writes:

B> What function languages do triggers support? C, plpgsql, pltcl, SQL?

You can add plruby.

How safe is plruby ?

Does it allow access to file system and other possibly unsafe resources ?

------------
Hannu

#4ts
decoux@moulon.inra.fr
In reply to: ts (#2)
Re: Trigger function languages

"H" == Hannu Krosing <hannu@tm.ee> writes:

H> How safe is plruby ?

I'll say that ruby is more safe than perl.

Ruby define 4 security levels :

/* safe-level:
0 - strings from streams/environment/ARGV are tainted (default)
1 - no dangerous operation by tainted string
2 - process/file operations prohibited
3 - all genetated strings are tainted
4 - no global (non-tainted) variable modification/no direct output
*/

You have a more complete description at :

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/2689

plruby, by default, is compiled with $SAFE >= 4

Guy Decoux

#5Alex Perel
veers@webhosting.com
In reply to: Bruce Momjian (#1)
Re: Trigger function languages

On Wed, 17 May 2000, Bruce Momjian wrote:

Any languages you can write stored procs in.

From the CREATE TRIGGER, it seems to say that only C functions are

supported by triggers. I see in the plpgsql manuals that it supports
triggers too.

What function languages do triggers support? C, plpgsql, pltcl, SQL?

--
Alex G. Perel -=- AP5081
veers@disturbed.net -=- veers@webhosting.com
play -=- work

Disturbed Networks - Powered exclusively by FreeBSD
== The Power to Serve -=- http://www.freebsd.org/