Extract the table and pipe it directly to the target database:
pg_dump -t table_to_copy source_db | psql target_db
Note: If the other database already has the table set up, you should use the -a
flag to import data only, else you may see weird errors like "Out of memory":
pg_dump -a -t my_table my_db | psql target_db
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…