Postgresql 使用dblink

yum search postgresql-contrib*
yum install postgresql-contrib.i386
su - postgres
$ cat /usr/share/pgsql/contrib/dblink.sql | psql
$psql tst_db
$tst_db# select dblink_connect('host=localhost user= password=');
$tst_db# select dblink('select id from tst') as mytable (t int);
$tst_db# select dblink_exec('insert into tst (\'\2\')') as mytable (t int);

你可能感兴趣的:(java,sql,PostgreSQL)