Re: Triggers & Compiled C Language Functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Burr <andrew(dot)burr(at)level3(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Triggers & Compiled C Language Functions
Date: 2001-11-20 06:05:15
Message-ID: 28259.1006236315@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Andrew Burr <andrew(dot)burr(at)level3(dot)com> writes:
> What are all the security restrictions on stored procedures and compiled
> C language functions?

A C-coded function can do any durn thing you feel like programming;
there are no (and can't be any, AFAICS) security restrictions on it.

You should, however, think twice about how the external interactions
you intend will interact with Postgres' transaction model. Some
questions: if the transaction that called your function later gets
rolled back, would you wish that the external call had not been made?
If two different transactions invoke the C function, will it bother
you if the database thinks that transaction A logically precedes
transaction B even though the call order of the C function was B
before A? What if one of the two transactions later rolls back,
but the other still wants to commit?

It's real easy to shoot yourself in the foot in this realm.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Colin Barnard 2001-11-20 11:23:50 Re: Migrating db from Oracle to Postgresql
Previous Message Andrew McMillan 2001-11-19 23:42:36 Re: performance benefit with views?