Search Postgresql Archives

Re: Rename or Re-Create Constraints?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Carlos Mennens <carlos.mennens@xxxxxxxxx> writes:
> On Fri, Apr 8, 2011 at 8:35 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
>> I believe you can rename the underlying indexes and the constraints will
>> follow them.  (This works in HEAD anyway, not sure how far back.)

> I renamed the table name from 'accounts' to 'marketing' however all
> the constraints listed under 'indexes' are still named 'accounts_*'
> and I've tried to rename them but I can't find any information with an
> example command to rename the constraints:

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.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux