pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedtrigger between to different database
3+ messages / 3 participants
[nested] [flat]
* trigger between to different database
@ 2005-08-08 18:41 Haris Saybasili <haris.saybasili@gmail.com>
0 siblings, 2 replies; 3+ messages in thread
From: Haris Saybasili @ 2005-08-08 18:41 UTC (permalink / raw)
To: pgsql-sql
Hi everybody,
I have two databasese: database1 and database2. I want to set a
trigger on a table of database1 which will insert some values to a
table of database2.
Is it possible with postgresql? How can I find detailed information about that?
Thanks in advance,
haris
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: trigger between to different database
@ 2005-08-15 03:12 Michael Fuhr <mike@fuhr.org>
parent: Haris Saybasili <haris.saybasili@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Michael Fuhr @ 2005-08-15 03:12 UTC (permalink / raw)
To: Haris Saybasili <haris.saybasili@gmail.com>; +Cc: pgsql-sql
On Mon, Aug 08, 2005 at 09:41:22PM +0300, Haris Saybasili wrote:
>
> I have two databasese: database1 and database2. I want to set a
> trigger on a table of database1 which will insert some values to a
> table of database2.
You could use contrib/dblink but you wouldn't have transaction
semantics. For example, suppose you insert a record into database1
and the trigger inserts a record into database2. If you then roll
back the transaction in database1, there's no simple way to roll
back the changes in database2.
Another possibility would be to use LISTEN/NOTIFY, which does work
with transactions (NOTIFY messages aren't sent until and unless the
transaction commits). But this has problems too: you have to find
out what record(s) to insert, and what should happen if the insert
in database2 fails? Should the changes in database1 be rolled back
somehow, even though they've already been committed?
Do you really need separate databases? The problems described above
would go away if you used multiple schemas in the same database
instead of multiple databases.
--
Michael Fuhr
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: trigger between to different database
@ 2005-08-15 03:15 Kenneth Gonsalves <lawgon@thenilgiris.com>
parent: Haris Saybasili <haris.saybasili@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Kenneth Gonsalves @ 2005-08-15 03:15 UTC (permalink / raw)
To: pgsql-sql@postgresql.org, Haris Saybasili <haris.saybasili@gmail.com>
On Tuesday 09 Aug 2005 12:11 am, Haris Saybasili wrote:
> Hi everybody,
>
> I have two databasese: database1 and database2. I want to set a
> trigger on a table of database1 which will insert some values to a
> table of database2.
>
> Is it possible with postgresql? How can I find detailed information
> about that?
more sensible to use schemas
--
regards
kg
http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-08-15 03:15 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-08-08 18:41 trigger between to different database Haris Saybasili <haris.saybasili@gmail.com>
2005-08-15 03:12 ` Michael Fuhr <mike@fuhr.org>
2005-08-15 03:15 ` Kenneth Gonsalves <lawgon@thenilgiris.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