Re: Rename or Re-Create Constraints?
От
Carlos Mennens
Тема
Re: Rename or Re-Create Constraints?
Дата
Msg-id
BANLkTinO5fpQ0SQLnsUUf_9etdDqMxO+dg@mail.gmail.com
Ответ на
Re: Rename or Re-Create Constraints? (Tom Lane)
Список
Дерево обсуждения
Rename or Re-Create Constraints? Carlos Mennens <carlos.mennens@gmail.com>
Re: Rename or Re-Create Constraints? Tom Lane <tgl@sss.pgh.pa.us>
Re: Rename or Re-Create Constraints? Carlos Mennens <carlos.mennens@gmail.com>
Re: Rename or Re-Create Constraints? Tom Lane <tgl@sss.pgh.pa.us>
Re: Rename or Re-Create Constraints? Carlos Mennens <carlos.mennens@gmail.com>
Re: Rename or Re-Create Constraints? Adrian Klaver <adrian.klaver@gmail.com>
Re: Rename or Re-Create Constraints? Adrian Klaver <adrian.klaver@gmail.com>
Re: Rename or Re-Create Constraints? Carlos Mennens <carlos.mennens@gmail.com>
Re: Rename or Re-Create Constraints? Rob Sargent <robjsargent@gmail.com>
On Sat, Apr 9, 2011 at 12:58 PM, Tom Lane wrote: > ALTER INDEX accounts_pkey RENAME TO whatever > > On very old versions of PG you may have to spell that "ALTER TABLE" > instead of "ALTER INDEX", but it's the same thing either way. Thank you so much for clearing that up for me Tom! I just couldn't find anything documented or do I understand SQL enough to work through that w/o an example. I read the PostgreSQL documentation all morning and just couldn't find it. Also to make sure I did this correct, if I had an existing table w/o a PRIMARY KEY index / constraint, is the following correct? CREATE UNIQUE INDEX users_pkey ON public.users (id); CREATE INDEX I'm guessing that's how I generate a index / constraint on an existing table when it was generated during the table creation SQL command, right? Is there a difference between an INDEX and a CONSTRAINT?
В списке pgsql-general по дате отправления