Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
sudo PATH=/usr/lib/postgresql/9.1/bin/:$PATH make USE_PGXS=1 clean


sudo ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/i386/server/libjvm.so /usr/lib/libjvm.so


CREATE EXTENSION jdbc_fdw;

– MySQL JDBC

sudo -u postgres psql postgres;

CREATE SERVER jdbc_mysql FOREIGN DATA WRAPPER jdbc_fdw OPTIONS(
    drivername 'com.mysql.jdbc.Driver',
    url 'jdbc:mysql://192.168.1.2:3306/bookshoputem',
    querytimeout '15',
    jarfile '/home/user2010/Documents/DBLINK/lib/mysql-connector-java-5.1.22-bin.jar',
    maxheapsize '600'
    );


CREATE USER MAPPING FOR postgres SERVER jdbc_mysql OPTIONS(username 'root',password 'abc123');

CREATE FOREIGN TABLE Inventory_mysql
(int_inventoryid VARCHAR(10) ,
int_stockin int ,
int_stockout int ,
int_balancequantity int ,
int_reorderlevel int ,
bk_isbn VARCHAR(20)) 
SERVER jdbc_mysql
OPTIONS (table 'Inventory');
----------------------

While I run this command, I just get data from mysql, but it doesn't delete or update from mysql database. Please help me.

share|improve this question
2  
Maybe your MySQL credentials only allow read-only data access? – mvp Dec 20 '12 at 5:49
add comment (requires an account with 50 reputation)

1 Answer

Documentation says:

Currently, foreign tables are read-only. 
This limitation may be fixed in a future release.

Try to use dblink. Some helpful information is here.

share|improve this answer
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.