Dblink and ISDN 
Author Message
 Dblink and ISDN

Quote:

> 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;

Quote:

> 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

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

http://www.***.com/



Sun, 19 Sep 2004 01:51:20 GMT
 Dblink and ISDN

Out of curiousity, what happens if the remove server is unavailable?
Quote:
----- Original Message -----



Sent: Tuesday, April 02, 2002 12:58 PM
Subject: Re: [HACKERS] Dblink and ISDN



> >> 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;

> Oops, messed up my cut and paste, and forgot to double the quotes
around
> bytea%. This one I tested ;) to work fine:
> 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
> WHERE proname LIKE ''bytea%''')
> as dblink_p) as t1;

> Joe

> ---------------------------(end of
broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to

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

http://archives.postgresql.org



Sun, 19 Sep 2004 04:07:13 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. pgsql/contrib/dblink README.dblink dblink.c db ...

2. pgsql/contrib/dblink README.dblink dblink.c db ...

3. pgsql/contrib/dblink README.dblink dblink.c

4. pgsql-server/contrib/dblink dblink.c dblink.sql.in

5. pgsql-server/contrib/dblink expected/dblink.ou ...

6. pgsql-server/contrib/dblink dblink.c

7. pgsql-server/contrib/dblink README.dblink dbli ...

8. pgsql/contrib/dblink dblink.c

9. pgsql-server/ ontrib/dblink/dblink.c ontrib/in ...

10. pgsql-server/contrib/dblink Makefile dblink.sq ...

11. pgsql-server/contrib/dblink dblink.test.expect ...

12. pgsql/ ontrib/dblink/dblink.c ontrib/dbsize/db ...


 
Powered by phpBB® Forum Software