I just had to do this exact thing so I figured I’d post the recipe here. This assumes that both databases are on the same server.
First, copy the table from the old db to the new db. At the commandline:
pg_dump -U postgres -t <old_table> <old_database> | psql -U postgres -d <new_database>
Next, grant permissions of the copied table to the user of the new database. Log into psql:
psql -U postgres -d <new_database>
ALTER TABLE <old_table> OWNER TO <new_user>;
\q
At this point your copied table in your new database still has the name <old_table> from your old database. Assuming you want to move the data somewhere else, say to <new_table>, you can just use regular SQL queries:
INSERT INTO <new_table> (field1, field2, field3)
SELECT field1, field2, field3 from <old_table>;
Done!