Skip to main content

Posts

Showing posts with the label foreign servers

FOREIGN TABLES

FOREIGN TABLES/DATA WRAPPERS =============================== Foreign data wrapper is a library which understand the heterogeneous database information. For example, PostgreSQL does not understand the MYSQL data structure/information since both engines have different mechanism. If we want to get any heterogeneous database information then we need to configure the respective fdw(Foreign Data Wrapper) into the PostgreSQL Library location. Please find the below link, which gives you all the available Foreign Data Wrappers. http://wiki.postgresql.org/wiki/Foreign_data_wrappers Here we have chosen MYSQL table as a source to PostgreSQL. Below are the steps. 1) Install mysql and mysql-devel using yum . yum install mysql* 2) Install PostgreSQL 9.1 through EnterpriseDB graphical installer. 3) Get the MYSQL FDW from the below link. https://github.com/dpage/mysql_fdw/archive/master.tar.gz 4) set the "PATH" as shown below. export PATH=<PostgreSQL 9.1 Bin>:<Mysql...

DBLINK in PostgreSQL

Hi, Find the below DBLINK concepts in PostgreSQL, PostgresPlus as well. PostgreSQL ---------- Foreign Data Wrapper -------------------- This is the one utility which encapsulates the data from the different Database servers using Handler functions. Ex:- In PG 9.1, we can encapsulates the data from My Sql and store to PostgreSQL using handlers. CREATE FOREIGN DATA WRAPPER HANDLER VALIDATOR ; Currently(<= 9.0) PostgreSQL compatible with only remote PostgreSQL. From 9.1 onwards, we can make the PostgreSQL to communicate with SQL Server/My SQL through these wrappers. Servers ------- This is the one object which is having the Data wrapper methodology as well the remote host connectivity details. Ex:- CREATE SERVER FOREIGN DATA WRAPPER OPTIONS (address , port ,dbname ); User Mapping ------------ This is the one object which maps the current dbserver user/role to remote dbserver user. Ex:-CREATE USER MAPPING FOR SERVER OPTIONS (username , password ); DBLINK ...