pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Triggers
8+ messages / 8 participants
[nested] [flat]

* Triggers
@ 2003-04-08 13:30  Ben Clewett <B.Clewett@roadrunner.uk.com>
  0 siblings, 2 replies; 8+ messages in thread

From: Ben Clewett @ 2003-04-08 13:30 UTC (permalink / raw)
  To: ; +Cc: pgsql-novice <pgsql-novice@postgresql.org>

Dear Novice,

I want to have a go at some Triggers.  To update summary records of 
accounting data.

I see in the reference manual 
http://www.de.postgresql.org/users-lounge/docs/7.2/postgres/sql-createconstraint.html 
it makes the comment:

"It is not intended for general use."

Does this mean that there is a problem with triggers I should be aware of?

Thanks,

Ben




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Triggers
@ 2003-04-08 15:33  A.Bhuvaneswaran <bhuvanbk@yahoo.com>
  parent: Ben Clewett <B.Clewett@roadrunner.uk.com>
  1 sibling, 0 replies; 8+ messages in thread

From: A.Bhuvaneswaran @ 2003-04-08 15:33 UTC (permalink / raw)
  To: Ben Clewett <B.Clewett@roadrunner.uk.com>; +Cc: pgsql-novice <pgsql-novice@postgresql.org>

> I want to have a go at some Triggers.  To update summary records of 
> accounting data.
> 
> I see in the reference manual 
> http://www.de.postgresql.org/users-lounge/docs/7.2/postgres/sql-createconstraint.html 
> it makes the comment:
> 
> "It is not intended for general use."

postgres uses CREATE CONSTRAINT TRIGGER to create FK references during 
pg_dump process. CREATE TRIGGER is what you are looking for.

regards,
bhuvaneswaran




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Triggers
@ 2003-04-08 19:15  Josh Berkus <josh@agliodbs.com>
  parent: Ben Clewett <B.Clewett@roadrunner.uk.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Josh Berkus @ 2003-04-08 19:15 UTC (permalink / raw)
  To: Ben Clewett <B.Clewett@roadrunner.uk.com>; +Cc: pgsql-novice <pgsql-novice@postgresql.org>

Ben,

> I want to have a go at some Triggers.  To update summary records of 
> accounting data.
> 
> I see in the reference manual 
> 
http://www.de.postgresql.org/users-lounge/docs/7.2/postgres/sql-createconstraint.html 
> it makes the comment:
> 
> "It is not intended for general use."
> 
> Does this mean that there is a problem with triggers I should be aware of?

No, it means that you're in the wrong part of the documentation.  You want 
"CREATE TRIGGER" not "CREATE CONSTRAINT TRIGGER".

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* triggers
@ 2005-09-08 20:59  Kailash Vyas <kailash.vyas@gmail.com>
  0 siblings, 3 replies; 8+ messages in thread

From: Kailash Vyas @ 2005-09-08 20:59 UTC (permalink / raw)
  To: pgsql-admin

hi

I have a query regarding triggers.
On INSERT, UPDATE, DELETE I want to fire a trigger to relect it to another 
database on postgres sever.
how can I do this operation.

Thanks in advance,
Kailash Vyas

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: triggers
@ 2005-09-08 21:29  Guido Barosio <gbarosio@gmail.com>
  parent: Kailash Vyas <kailash.vyas@gmail.com>
  2 siblings, 0 replies; 8+ messages in thread

From: Guido Barosio @ 2005-09-08 21:29 UTC (permalink / raw)
  To: Kailash Vyas <kailash.vyas@gmail.com>; +Cc: pgsql-admin

http://www.google.co.uk/search?hl=en&q=TRIGGER+%2B+postgresql+%2B+8&meta=
 which actually will guide you to:
 http://www.postgresql.org/docs/current/static/sql-createtrigger.html
 ..that actually is the pgsql man.
 rtfm :)
 Best wishes,
Guido

 On 9/8/05, Kailash Vyas <kailash.vyas@gmail.com> wrote: 
> 
> hi
> 
> I have a query regarding triggers.
> On INSERT, UPDATE, DELETE I want to fire a trigger to relect it to another 
> database on postgres sever.
> how can I do this operation.
> 
> Thanks in advance,
> Kailash Vyas
> 
> 


-- 
"Adopting the position that you are smarter than an automatic
optimization algorithm is generally a good way to achieve less
performance, not more" - Tom Lane.

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: triggers
@ 2005-09-08 22:01  Stephan Szabo <sszabo@megazone.bigpanda.com>
  parent: Kailash Vyas <kailash.vyas@gmail.com>
  2 siblings, 0 replies; 8+ messages in thread

From: Stephan Szabo @ 2005-09-08 22:01 UTC (permalink / raw)
  To: Kailash Vyas <kailash.vyas@gmail.com>; +Cc: pgsql-admin

On Thu, 8 Sep 2005, Kailash Vyas wrote:

> hi
>
> I have a query regarding triggers.
> On INSERT, UPDATE, DELETE I want to fire a trigger to relect it to another
> database on postgres sever.
> how can I do this operation.

This is tricky, because you probably want to have the same transactional
occurances as well (ie, rollbacks not leaving the rolledback data on the
other database).  You might be best off looking at some of the replication
systems for PostgreSQL to see what they do (or perhaps just using one).




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: triggers
@ 2005-09-08 22:29  Chris Browne <cbbrowne@acm.org>
  parent: Kailash Vyas <kailash.vyas@gmail.com>
  2 siblings, 0 replies; 8+ messages in thread

From: Chris Browne @ 2005-09-08 22:29 UTC (permalink / raw)
  To: pgsql-admin

kailash.vyas@gmail.com (Kailash Vyas) writes:
> hi
> I have a query regarding triggers.
> On INSERT, UPDATE, DELETE I want to fire a trigger to relect it to another database on postgres sever.
> how can I do this operation.
> Thanks in advance,
> Kailash Vyas

If you wish the trigger to result in some action taking place on 
another database, then there are two major methodologies available: 
 
 1.  The trigger could RAISE an event. 
 
     A LISTENing daemon would see that event, and do something in the 
     other database. 
 
 2.  The trigger could write data into a replicated table. 
 
     The replication system (possibly Slony-I?) would then copy 
     the replicable data to the other database. 

-- 
"cbbrowne","@","cbbrowne.com"
http://cbbrowne.com/info/slony.html
Rules of the Evil Overlord #52. "I will hire a team of board-certified
architects and  surveyors to  examine my castle  and inform me  of any
secret passages  and abandoned tunnels  that I might not  know about."
<http://www.eviloverlord.com/;



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* triggers
@ 2005-11-21 05:08  Enzo D'addario <enzo@pienetworks.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Enzo D'addario @ 2005-11-21 05:08 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I originally implemented a number of triggers in our production DB using
'plpgsql' and they have been running flawlessly for many years.

It has now become necessary to split up our main DB into a number of
separate DB's.

My question is:

Is it possible for a table insert/update(via trigger) in one DB to
insert/update a different table in a different DB(on the same server
running the same version of postgres)? 

Thanks Enzo...




^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2005-11-21 05:08 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-08 13:30 Triggers Ben Clewett <B.Clewett@roadrunner.uk.com>
2003-04-08 15:33 ` A.Bhuvaneswaran <bhuvanbk@yahoo.com>
2003-04-08 19:15 ` Josh Berkus <josh@agliodbs.com>
2005-09-08 20:59 triggers Kailash Vyas <kailash.vyas@gmail.com>
2005-09-08 21:29 ` Re: triggers Guido Barosio <gbarosio@gmail.com>
2005-09-08 22:01 ` Re: triggers Stephan Szabo <sszabo@megazone.bigpanda.com>
2005-09-08 22:29 ` Re: triggers Chris Browne <cbbrowne@acm.org>
2005-11-21 05:08 triggers Enzo D'addario <enzo@pienetworks.com>

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