I have a simple model in postgresql database and I want to replicate rows of this table in another database in another machine.
The replication should be for some columns of this table and not for all columns.
What is the solution?
If by replication you mean import, look into foreign data wrappers:
http://wiki.postgresql.org/wiki/Foreign_data_wrappers
One of them ought to do the trick.
If you truly mean replication, then… if the other DB is not using Postgres, you could imagine using the above and triggers to keep the changes in sync, assuming of course that Postgres remains the master. If it is using Postgres, there are plenty of additional options to choose from:
http://www.postgresql.org/docs/current/static/high-availability.html
Take a look at the db_link module. You could try something like:
create extension dblink;
then once you have that installed:
select dblink_connect('myconn', 'hostaddr=127.0.0.1 port=5432 dbname=gis user=ubuntu password=ubuntu');
create table some_columns_table as select * from dblink('myconn','select col1, col2 from all_columns_table') AS t(col1 int, col2 text, col3 text);
select dblink_disconnect('myconn);