Thread: dblink & 4 master operation

dblink & 4 master operation

From
Mohsen Pahlevanzadeh
Date:
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


Re: dblink & 4 master operation

From
Mohsen Pahlevanzadeh
Date:
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...........


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