Re: How can I quit this: "Unique " to my table? - Mailing list pgsql-sql

From David Witham
Subject Re: How can I quit this: "Unique " to my table?
Date
Msg-id CFA248776934FD43847E740E43C346D13796A6@ozimelb03.ozicom.com
Whole thread Raw
In response to How can I quit this: "Unique " to my table?  (Luis Mix <ksql2002@yahoo.com.mx>)
Responses Re: How can I quit this: "Unique " to my table?  (chester c young <chestercyoung@yahoo.com>)
List pgsql-sql
Hi Luis,

I presume you want to remove the unique column constraint?

The ALTER TABLE command doesn't allow you to do this so another way is as follows:

pg_dump -t b_prestamo MyDatabase > b_prestamo.sql
Edit the b_prestamo.sql file:Add DROP TABLE b_prestamo; before the create table statement.Remove the unique keyword
fromthe no_inventa column 
psql MyDatabase < b_prestamo.sql

This will drop and recreate the table and reload the data currently in the table (the pg_dump file contains the schema
andthe data for the table). 

If you have any reference or foreign key constraints that refer to the b_prestamo table, then you will need to drop
thoseconstraints and add them back after changing the table. 

Regards,
David Witham
Telephony Platforms Architect
Unidial

-----Original Message-----
From: Luis Mix [mailto:ksql2002@yahoo.com.mx]
Sent: Wednesday, 2 April 2003 00:35
To: pgsql-sql@postgresql.org
Subject: [SQL] How can I quit this: "Unique " to my table?


Hello pgsql-sql,
 When my table was create I wrote this:
 MyDatabase=# create table b_prestamo(no_inventa char(16) unique not null, cve_area char(10), date1 date); I need now
thatmy table can accept repeated records, but not Null. How can I do that? SomeBody can help me please? My table has
informationat the moment,what can I do for maintain it?   

--
Best regards,Luis                          mailto:ksql2002@yahoo.com.mx


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly



pgsql-sql by date:

Previous
From: "James Taylor"
Date:
Subject: Rows as Columns
Next
From: chester c young
Date:
Subject: Re: How can I quit this: "Unique " to my table?