X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E517B47592C for ; Tue, 1 Apr 2003 19:18:20 -0500 (EST) Received: from ozimelb03.ozicom.com (unknown [203.185.247.100]) by postgresql.org (Postfix) with ESMTP id 69AF0475CBC for ; Tue, 1 Apr 2003 19:18:15 -0500 (EST) content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: How can I quit this: "Unique " to my table? X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Date: Wed, 2 Apr 2003 10:18:16 +1000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] How can I quit this: "Unique " to my table? Thread-Index: AcL4XT7og0sf7E9uQdOtp4KsD36/FwATumLA From: "David Witham" To: "Luis Mix" , X-Spam-Status: No, hits=-6.0 required=5.0 tests=BAYES_01,MAILTO_TO_SPAM_ADDR version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/15 X-Sequence-Number: 12716 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 f= ollows: 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 from the 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 and the data for the table). If you have any reference or foreign key constraints that refer to the b_pr= estamo table, then you will need to drop those constraints and add them bac= k 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=3D# create table b_prestamo(no_inventa char(16) unique not null, cve_area char(10), date1 date); I need now that my table can accept repeated records, but not Null. How can I do that? SomeBody can help me please? My table has information at the moment,what can I do for maintain it? =20=20 =20=20 --=20 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