I am new to this site, I have one major question of data migration, I apologize before hand if the question is too silly.
I have two data base on one server, I have one table with the same schema on both the databases, and the database is not primary, I have made it composite, that is , always I have to provide two keys instead of one key to fetch a tuple.
Now I have to migrate specific data from one database to another let say only those data which has 'batch id 1258' and batch id is included to make the entire database as composite that is; batch id and any table's primary key (batch id + table A primary key = composite key of Table A ) which is also referred as FK( FK is also composite ) to other table.
Now what I am supposed to do to migrate the all the data related to batch id 1258 only to another database and not other.
Should I write certain script to copy the entire data and insert it into the other database? or anything else, right now I am clueless, but I want to migrate these specific data anyhow.
Can we have some light on this, so that I can proceed with this!
I am using PostgrSQL 9.0.13
Example of Composite Key :
Table student was primary as only id field was there to fetch any record but I made it composite that is id + batch_id, and now both are used to fetch the records; whereas table batch have the id field which is used for the all tables in my Database to make it composite that is any random table_id + batch_id, as the table batch has batch specific data, which means it holds the batch year and which is repeated in the student table record.
And now I want only specific data to be migrated, which means the students who belong to batch 1258 from student table to another database on the same server.