Update primary keys in multiple tables using PostgreSQL
0 I have 11 tables in a single schema in PostgreSQL. Each table has a column named 'id' that should be a unique primary key. Unfortunately, some of the tables have ids that are in other tables. How can I create a new sequence and update all the tables' id values with fully unique values? Do I have to do it one sequence and one table at a time? I'm new at SQL, so I don't know where to start beyond creating a sequence and updating a single table. postgresql share | improve this question asked Nov 15 '18 at 0:36 Bird Bird 702 3 9 34 add a comment | 0 I have 11 tables in a single schema in PostgreSQL. Each table has a column named 'id' that should be a unique primary key. Unfortunately, some of the tables have ids that are in other tables. How can I create a new sequence and update all the tables' id values with fully unique values? Do I have to do it one sequence and one table at a time