Re: Question on triggers and plpgsql

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: John DeSoi <desoi(at)pgedit(dot)com>
Cc: Carlos Moreno <moreno(at)mochima(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Question on triggers and plpgsql
Date: 2005-04-08 13:41:57
Message-ID: fef7e50cf33b53ca481ecb2554cd6403@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Apr 8, 2005, at 8:28 AM, John DeSoi wrote:

>
> On Apr 7, 2005, at 5:45 PM, Carlos Moreno wrote:
>
>> The thing seems to work -- I had to go in a shell as user
>> postgres and execute the command:
>>
>> $ createlang -d dbname plpgsql
>>
>> (I'm not sure I understand why that is necessary, or
>> what implications -- positive or negative -- it may have)
>
> As a security measure, no pl language is available by default. What
> you did is correct. There is not much (any?) risk with pl/pgsql, so
> you can install it in template1 so it will be available in any new
> database you create.
>
>>
>> Am I doing the right thing? Have I introduced some sort
>> of catastrophe waiting to happen?
>
> I did not notice any problems.
>

Just one detail, but in the form of a question. In the original
posting, I think the trigger was doing the logging for something
happening on a table as a before insert or update--I may be wrong on
that detail. I would think of doing such actions AFTER the
update/insert. In the world of transaction-safe operations, is there
ANY danger in doing the logging as a BEFORE trigger rather than an
AFTER trigger?

Thanks,
Sean

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message John DeSoi 2005-04-08 14:13:02 Re: Question on triggers and plpgsql
Previous Message Joel Fradkin 2005-04-08 13:29:13 getting count for a specific querry