Need help on triggers - postgres 9.1.2 - Mailing list pgsql-general

From Khangelani Gama
Subject Need help on triggers - postgres 9.1.2
Date
Msg-id 336182dc49aa7a02fb3d6c2c716e6a4b@mail.gmail.com
Whole thread Raw
Responses Re: Need help on triggers - postgres 9.1.2  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general

Hi

 

I have a postgres 9 database, inside this database I need to create a new table called center_changed that gets inserted by any change that take place in a table called center. So I need to create trigger to do this.

 

Example:

 

Table name: center(c_cde, c_dsc, ops_cde, grp_cde);

 

Now on the table called center , I need to create an INSERT and UPDATE trigger will insert the c_cde  of the inserted or updated center into the center_changed table

 

 

Please help me

 

 

 

I have this syntax below, but please help me with the overall query.

 

 

CREATE TRIGGER check_center

 

 

               BEFORE INSERT OR UPDATE

 

 

               ON center FOR EACH ROW

 

 

               EXECUTE PROCEDURE check_center_changes();

 

 

 

 

 

Thanks

 

 

 

 

 


CONFIDENTIALITY NOTICE
The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
information of Argility (Proprietary) Limited and/or its subsidiaries. Any review, use or dissemination thereof by anyone
other than the intended addressee is prohibited.If you are not the intended addressee please notify the writer immediately
and destroy the e-mail. Argility (Proprietary) Limited and its subsidiaries distance themselves from and accept no liability
for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.

pgsql-general by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Force specific index disuse
Next
From: Jürgen Fuchsberger
Date:
Subject: Re: LDAP authentication not working