FUNCTION, TRIGGER and best practices

From: "Keith Worthington" <keithw(at)narrowpathinc(dot)com>
To: "PostgreSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: FUNCTION, TRIGGER and best practices
Date: 2004-12-17 04:05:20
Message-ID: 20041217040520.M87972@narrowpathinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2004-12-17 05:43:32 Re: FUNCTION, TRIGGER and best practices
Previous Message Keith Worthington 2004-12-17 01:23:03 Re: PERFORM statement question

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2004-12-17 05:43:32 Re: FUNCTION, TRIGGER and best practices
Previous Message Christopher Browne 2004-12-17 03:33:49 Re: plpgsql.. SELECT INTO ... WHERE FIELD LIKE