[Pgsql-ayuda] Se puede hacer DBLink?

sandrigo lezcano psql@msa.com.py
Wed, 11 Jun 2003 13:34:13 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_013C_01C3301E.25A3CDB0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

----- Original Message -----=20
> From: Carlos Pe=F1aranda Sent: Wednesday, June 11, 2003 5:38 PM
> Subject: [Pgsql-ayuda] Se puede hacer DBLink?

> Existe en Postgres la posibilidad de hacer un DBLink como lo hace =
Oracle o SQL Server?



acabo de recibir, espero te sirva... (esta en portugues ..pero se =
entiende.)

--------------------------------------------------
--Consultar

SELECT * FROM dblink('dbname=3Dpgteste hostaddr=3D210.174.40.63 =
user=3Dpano
password=3Daaa port=3D5432','SELECT id, nome
from clientes') AS t1(id integer, nome varchar(30));

--Consultar remoto e criar uma tabela local

CREATE TABLE clientes_remoto AS SELECT * FROM dblink('dbname=3Dpgteste
hostaddr=3D200.174.40.63 user=3Dpano password=3Dass port=3D5432','SELECT =
id, nome
from clientes') AS t1(id integer, nome varchar(30));

--Inserir/atualizar/excluir
SELECT dblink_exec('dbname=3Dpgteste hostaddr=3D200.174.40.63 =
user=3Dpano
password=3Daaa port=3D5432','INSERT INTO clientes (nome) VALUES =
(''Neimar
Volpini'')');

--------------------------------------------------

-------------------------------------------------------------------------=
-----
  Do you Yahoo!?
  Free online calendar with sync to Outlook(TM).

------=_NextPart_000_013C_01C3301E.25A3CDB0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV style=3D"FONT: 10pt arial">&gt; <B>From:</B> <A =
title=3Dcalupe@yahoo.com=20
href=3D"mailto:calupe@yahoo.com">Carlos Pe=F1aranda</A> <B>Sent:</B> =
Wednesday, June=20
11, 2003 5:38 PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>&gt; Subject:</B> [Pgsql-ayuda] Se =
puede hacer=20
DBLink?</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV>&gt; Existe en Postgres la posibilidad de hacer un DBLink como lo =
hace=20
Oracle o SQL Server?</DIV></DIV></FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>acabo de recibir, espero te sirva... (esta en =
portugues ..pero=20
se entiende.)</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV>--------------------------------------------------<BR>--Consultar<BR=
><BR>SELECT=20
* FROM dblink('dbname=3Dpgteste hostaddr=3D210.174.40.63 =
user=3Dpano<BR>password=3Daaa=20
port=3D5432','SELECT id, nome<BR>from clientes') AS t1(id integer, nome=20
varchar(30));<BR><BR>--Consultar remoto e criar uma tabela =
local<BR><BR>CREATE=20
TABLE clientes_remoto AS SELECT * FROM=20
dblink('dbname=3Dpgteste<BR>hostaddr=3D200.174.40.63 user=3Dpano =
password=3Dass=20
port=3D5432','SELECT id, nome<BR>from clientes') AS t1(id integer, nome=20
varchar(30));<BR><BR>--Inserir/atualizar/excluir<BR>SELECT=20
dblink_exec('dbname=3Dpgteste hostaddr=3D200.174.40.63 =
user=3Dpano<BR>password=3Daaa=20
port=3D5432','INSERT INTO clientes (nome) VALUES=20
(''Neimar<BR>Volpini'')');<BR><BR>---------------------------------------=
-----------</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <HR SIZE=3D1>
  Do you Yahoo!?<BR>Free <A=20
  =
href=3D"http://us.rd.yahoo.com/mail_us/tag/*http://calendar.yahoo.com">on=
line=20
  calendar</A> with sync to Outlook(TM).</BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_013C_01C3301E.25A3CDB0--