dbTalk Databases Forums  

update data in different database

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss update data in different database in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Henriksen, Jonas F
 
Posts: n/a

Default update data in different database - 10-27-2004 , 06:42 AM






Hi,

is it possible to write a trigger, using pl/pgSQL, that updates tables in a different database than the one the trigger is called from? If it is, what is the syntax for calling the other database? My to databases are on the same server.

Regards Jonas)

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #2  
Old   
Karsten Hilbert
 
Posts: n/a

Default Re: update data in different database - 10-27-2004 , 07:04 AM






Quote:
is it possible to write a trigger, using pl/pgSQL, that
updates tables in a different database than the one the trigger
is called from? If it is, what is the syntax for calling the
other database? My to databases are on the same server.
One way I can think of is using dblink from the contrib/
directory. It can be used to connect to another database from
within the one you are primarily connected to.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
  #3  
Old   
Richard Huxton
 
Posts: n/a

Default Re: update data in different database - 10-27-2004 , 07:20 AM



Henriksen, Jonas F wrote:
Quote:
Hi,

is it possible to write a trigger, using pl/pgSQL, that updates
tables in a different database than the one the trigger is called
from? If it is, what is the syntax for calling the other database? My
to databases are on the same server.
Look into the dblink package in the contrib directory of the source
distribution (or your contrib package)

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.