Unix Technical Forum

dblink + rule on select

This is a discussion on dblink + rule on select within the pgsql Novice forums, part of the PostgreSQL category; --> hi, i'd like to write sth like: create rule MYRULE as on select to MYTABLE do instead dblink('dbname=ANOTHERDB',querystring); where ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:40 PM
f.g@no-log.org
 
Posts: n/a
Default dblink + rule on select


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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com