dblink & 4 master operation

Started by Mohsen Pahlevanzadehover 16 years ago2 messagesgeneral
Jump to latest
#1Mohsen Pahlevanzadeh
mohsen@pahlevanzadeh.org

Dear all,

My boss requested me that i use dblink even for a sample INSERT, now i
have a INSERT query, But i don't know how to invoke insert query without
select query.
I have search for doc in this topic, But i just saw API ref in
postgresql.org.
Can u help me?

Yours,
Mohsen

#2Mohsen Pahlevanzadeh
mohsen@pahlevanzadeh.org
In reply to: Mohsen Pahlevanzadeh (#1)
Re: dblink & 4 master operation

Dear all,
I use following command :
su -
su postgres
cd ~
psql urldump
urldump=# \i /usr/share/postgresql/8.4/contrib/dblink.sql
.....
urldump=# select dblink_connect('my','dbname=urldump');
dblink_connect
----------------
OK
(1 row)
urldump=# select dblink('my','INSERT INTO ipmap (ip,username) VALUES
("127.0.0.1","mohsen");');
ERROR: column "127.0.0.1" does not exist
CONTEXT: Error occurred on dblink connection named "unnamed": could not
execute query.
urldump=#

/////////////////////////////////////////////////////////////////////

I need to insert into ipmap table with ip & username columns.Please help
me...........

Show quoted text

On Sat, 2009-09-12 at 16:10 +0430, Mohsen Pahlevanzadeh wrote:

Dear all,

My boss requested me that i use dblink even for a sample INSERT, now i
have a INSERT query, But i don't know how to invoke insert query without
select query.
I have search for doc in this topic, But i just saw API ref in
postgresql.org.
Can u help me?

Yours,
Mohsen