Search Postgresql Archives

Rename or Re-Create Constraints?

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

 



I've searched and really can't find a definitive example or someone
renaming a constraint. I renamed a table yesterday and noticed that
the constraint name was still named the old table name:

inkpress=# ALTER TABLE accounts RENAME TO fashion;
ALTER TABLE

inkpress=# \d fashion
           Table "public.fashion"
 Column  |         Type          | Modifiers
---------+-----------------------+-----------
 id      | integer               | not null
 vendor  | character varying(40) | not null
 account | integer               | not null
 email   | character varying(40) | not null
 state   | character(2)          | not null
Indexes:
    "accounts_pkey" PRIMARY KEY, btree (id)
    "accounts_account_key" UNIQUE, btree (account)
    "accounts_email_key" UNIQUE, btree (email)
    "accounts_vendor_key" UNIQUE, btree (vendor)

1. Do I need to remove all the table constraints or is there a way to
rename them?

2. When renaming the table, is there a way to rename both the table
and all associated constraints?

I've looked over the following guide and am more confused than ever:

http://www.postgresql.org/docs/8.1/static/sql-altertable.html

-- 
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