Re: Question on triggers and plpgsql - Mailing list pgsql-sql

From Sean Davis
Subject Re: Question on triggers and plpgsql
Date
Msg-id fef7e50cf33b53ca481ecb2554cd6403@mail.nih.gov
Whole thread Raw
In response to Re: Question on triggers and plpgsql  (John DeSoi <desoi@pgedit.com>)
Responses Re: Question on triggers and plpgsql
Re: Question on triggers and plpgsql
List 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



pgsql-sql by date:

Previous
From: "Joel Fradkin"
Date:
Subject: getting count for a specific querry
Next
From: John DeSoi
Date:
Subject: Re: Question on triggers and plpgsql