pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Keith Worthington <keithw@narrowpathinc.com>
To: PostgreSQL Novice <pgsql-novice@postgresql.org>
Subject: FUNCTION, TRIGGER and best practices
Date: Thu, 16 Dec 2004 23:05:20 -0500
Message-ID: <20041217040520.M87972@narrowpathinc.com> (raw)

Hi All,

I have a function/trigger pair operating that move data from one table to
another after that data is inserted into the first table.

Can triggers and functions have the same name?
Is this a good practice?
Where should the function and trigger be stored?
In the same schema as the table they are connected to?

I will now be attempting to expand this function to move data from two source
tables to four or more target tables.  (Different source columns go to
different tables.)  Is it possible to do a transaction/commit/rollback inside
a function that is driven by a trigger so that if any portion of the transfer
fails it is all rolled back?

Thanks to all on this list that have helped me get this far. :-)

Kind Regards,
Keith

______________________________________________
99main Internet Services http://www.99main.com




view thread (3+ messages)  latest in thread

Message-ID: <20041217040520.M87972@narrowpathinc.com>
Permalink:  ../20041217040520.M87972@narrowpathinc.com/
Also on:    postgresql.org/message-id/20041217040520.M87972@narrowpathinc.com

 · 

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: keithw@narrowpathinc.com, pgsql-novice@postgresql.org
  Subject: Re: FUNCTION, TRIGGER and best practices
  In-Reply-To: <20041217040520.M87972@narrowpathinc.com>

* 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