pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sean Davis <sdavis2@mail.nih.gov>
To: John DeSoi <desoi@pgedit.com>
Cc: Carlos Moreno <moreno@mochima.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Question on triggers and plpgsql
Date: Fri, 8 Apr 2005 09:41:57 -0400
Message-ID: <fef7e50cf33b53ca481ecb2554cd6403@mail.nih.gov> (raw)
In-Reply-To: <BE1E8DAA-A829-11D9-9125-000A95B03262@pgedit.com>
References: <4255AA15.8000508@mochima.com>
	<BE1E8DAA-A829-11D9-9125-000A95B03262@pgedit.com>


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




view thread (14+ messages)  latest in thread

Message-ID: <fef7e50cf33b53ca481ecb2554cd6403@mail.nih.gov>
Permalink:  ../fef7e50cf33b53ca481ecb2554cd6403@mail.nih.gov/
Also on:    postgresql.org/message-id/fef7e50cf33b53ca481ecb2554cd6403@mail.nih.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sdavis2@mail.nih.gov, desoi@pgedit.com, moreno@mochima.com
  Subject: Re: Question on triggers and plpgsql
  In-Reply-To: <fef7e50cf33b53ca481ecb2554cd6403@mail.nih.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox