Removing foreign key and adding sequence
От | Chad Thompson |
---|---|
Тема | Removing foreign key and adding sequence |
Дата | |
Msg-id | 000901c33c05$781aa120$32021aac@chad обсуждение исходный текст |
Ответы |
Re: Removing foreign key and adding sequence
|
Список | pgsql-novice |
I have a table of 12 M records. When this table was created a specific foreign key constraint was very necessary to ensure the data was correct. I have now built enough checks through software that this foreign key is hindering performance more than it is useful. So my idea is this. alter table lists rename to lists_bak; select * from lists_bak into lists; I can add the constraints and foreign key's back in that ARE necessary, my only worry (and mabey you can think of another worry) is that my sequence is no longer attached to the id field of my table. Is this the right approach, and if so, how do I add my sequence back in? #select version(); version ---------------------------------------------------------------------------- ----------------------------- PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) TIA Chad
В списке pgsql-novice по дате отправления: