Re: Can't drop constraint?

Поиск
Список
Период
Сортировка
От Carol Walter
Тема Re: Can't drop constraint?
Дата
Msg-id 908CA552-831C-44D7-8DDD-0528A9C81FBA@indiana.edu
обсуждение исходный текст
Ответ на Re: Can't drop constraint?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Can't drop constraint?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin

On May 5, 2009, at 12:08 PM, Tom Lane wrote:

Carol Walter <walterc@indiana.edu> writes:
I don't know how they did this, but I have a table that has a compound  
field constraint.  When I try to insert data into this table from an  
app I'd developing the query fails because the data supposedly  
violates the unique constraint on these fields.  The fields are first,  
middle, and last names.  The name I'm trying to insert doesn't exist  
in the database, yet I can't put it in.  When I try to drop the  
constraint, which I can plainly see when I describe the table,  
postgres tells me that the constraint doesn't exist.  How can I fix  
this?

Since you haven't shown us exactly what you're seeing, we're just
guessing ... but I'm wondering if the constraint has a mixed-case
name and you've forgotten to double-quote it.

I'm sorry, I should have included this.  Here is what I'm seeing.  This is PostgreSQL 8.3.6 on Solaris 10.

km_tezt=# \d "tblPeople";
                                      Table "public.tblPeople"
  Column  |          Type          |                           Modifiers                            
----------+------------------------+----------------------------------------------------------------
 peopleId | integer                | not null default nextval('"tblPeople_peopleId_seq"'::regclass)
 fName    | character varying(70)  | 
 mName    | character varying(70)  | 
 lName    | character varying(100) | 
 ivlweb   | boolean                | 
 cnsweb   | boolean                | 
Indexes:
    "primary_key_tblPeople" PRIMARY KEY, btree ("peopleId")
    "people_all_fields" UNIQUE, btree ("lName", "fName", "mName")

km_tezt=# alter table "tblPeople" drop constraint "people_all_fields";
ERROR:  constraint "people_all_fields" does not exist

Thanks,
Carol

regards, tom lane

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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Marc Cousin
Дата:
Сообщение: Re: can't cancel a query with pg_cancel_backend
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Can't drop constraint?