From: | Joe Conway <mail(at)joeconway(dot)com> |
---|---|
To: | Darko Prenosil <Darko(dot)Prenosil(at)finteh(dot)hr> |
Cc: | Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Dblink and ISDN |
Date: | 2002-04-02 17:49:52 |
Message-ID: | 3CA9EF40.9070600@joeconway.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Darko Prenosil wrote:
> SAMPLE:
>
> create view myremotetable as
> select dblink_tok(t1.dblink_p,0) as f1, dblink_tok(t1.dblink_p,1) as f2
> from (select dblink('hostaddr=127.0.0.1 port=5432 dbname=template1
> user=postgres password=postgres'
> ,'select proname, prosrc from pg_proc') as dblink_p)
> as t1;
>
>
>
> select f1, f2 from myremotetable where f1 like 'bytea%';
>
You could write the query directly instead of using a view, i.e.
select dblink_tok(t1.dblink_p,0) as f1, dblink_tok(t1.dblink_p,1) as f2
from (select dblink('hostaddr=127.0.0.1 port=5432 dbname=template1
user=postgres password=postgres','select proname, prosrc from pg_proc')
as dblink_p WHERE proname LIKE 'bytea%') as t1;
>
>
> Is it possible to write a rule that uses the current SQL expression and
> sends this expression to the remote database ?
>
> In this case only wanted data would be send through the network.
>
I'm not experienced in using PostgreSQL rules, but I don't see a way to
access the current SQL expression. Hopefully someone more knowledgeable
will chime in here.
Joe
From | Date | Subject | |
---|---|---|---|
Next Message | Joe Conway | 2002-04-02 17:58:55 | Re: Dblink and ISDN |
Previous Message | Vince Vielhaber | 2002-04-02 17:30:36 | Re: v7.2.1 Released: Critical Bug Fix |