Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-novicepgsql-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

pgsql-novice by date

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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group