dblink + rule on select

From: f(dot)g(at)no-log(dot)org
To: pgsql-novice(at)postgresql(dot)org
Subject: dblink + rule on select
Date: 2006-03-04 17:26:21
Message-ID: 1245.83.179.5.146.1141493181.squirrel@webmail.no-log.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


hi, i'd like to write sth like:

create rule MYRULE as on select to MYTABLE do instead
dblink('dbname=ANOTHERDB',querystring);

where querystring would be a special keyword, as new and old, but
containing the full query which the rule is invoked, so if i do

insert into TOTO select * from MYTABLE where ... ;

it will act as

insert into TOTO dblink('dbname=ANOTHERDB','select * from MYTABLE where
...') ;

is there any way to do such, i mean to hide the dblink, so MYTABLE is the
real MYTABLE on ANOTHERDB, but looks like a normal local table...

Browse pgsql-novice by date

  From Date Subject
Next Message f g 2006-03-04 17:30:17 dblink + rule on select
Previous Message Thomas Hallgren 2006-03-04 09:11:11 Re: pg_config --pgxs