How to Merge Identical Tables in PostgreSQL forcing different serial numbers.
My scenario: first column is a bigserial number that are primary keys set to auto grow by increment 1 in a sequence. but they all start with 1,2,3,4.... in both tables.
Table: Data1
1|A 2|B 3|C
Table: Data2
1|D 2|E 3|F
Results should be:
1|A 2|B 3|C 4|D 5|E 6|F
Required criteria: the serial numbers should remain unique for all rows after merging.
I have two questions:
Can someone help me figure out how to create a query to merge two identical tables in PostgreSQL 8.4+ or 9+?
Is there a way within PostgreSQL commands or PgAdmin or some utility to directly merge the two tables?
Please guide me.