Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 9472A4763D8 for ; Tue, 14 May 2002 17:47:03 -0400 (EDT) Received: from ciderbox.stanaway.net (ciderbox.stanaway.net [170.76.50.98]) by postgresql.org (Postfix) with ESMTP id E3D20475D12 for ; Tue, 14 May 2002 16:52:40 -0400 (EDT) Received: by ciderbox.stanaway.net (Postfix, from userid 1000) id 044D693659; Tue, 14 May 2002 15:52:29 -0500 (CDT) Subject: Re: ALTER TABLE for field modify... From: David Stanaway To: MG Cc: PostgreSQL List In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-SjHDEQ4C40UAPsqnR/6n" X-Mailer: Ximian Evolution 1.0.3 Date: 14 May 2002 15:52:29 -0500 Message-Id: <1021409549.996.2407.camel@ciderbox> Mime-Version: 1.0 X-Archive-Number: 200205/123 X-Sequence-Number: 4298 --=-SjHDEQ4C40UAPsqnR/6n Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2002-05-14 at 11:24, MG wrote: >=20 > On 03-May-2002 Nick Fankhauser wrote: > > alter table drop constraint ID unique; > > alter table drop constraint ID not null; > >=20 > > alter table add constraint ID references table2 ; > >=20 >=20 > Hi! >=20 > It not works. :( > I try it: > proba=3D# create table "tabla1" ("ID" int8 NOT NULL UNIQUE, "nev" varchar= (20) ); > NOTICE: CREATE TABLE/UNIQUE will create implicit index 'tabla1_ID_key' f= or > table 'tabla1' In this case the row is ID (Case sensitive) so whenever you refer to it you must refer to it as "ID" > CREATE > proba=3D# create table "tabla2" ("ID2" int8 NOT NULL UNIQUE, "nev2" varch= ar(20) ); > NOTICE: CREATE TABLE/UNIQUE will create implicit index 'tabla2_ID2_key' = for > table 'tabla2' > CREATE >=20 > proba=3D# alter table tabla1 drop constraint ID not null; Here you refer to it as ID which is case folded to id and does not refer to the column named ID. I don't know if that is your problem, but it is one problem with your code. and it will no doubt show up in many more places. -- David Stanaway --=-SjHDEQ4C40UAPsqnR/6n Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iQEXAwUAPOF5Db6yIDFGeSAyFALmbAP/aaiE7lCjp6wBGwllimnY8qHdOO/LwT53 nuzNNYfRG6BkXrr/uVNjPmcv8FjFc+LtFvLqutjlEFBl7BWv9mFCALzBsbPXRcsF 7N4sYRmOmdYuVEK3ydJsjKrBSeu4Nyunj+8m2VYxHTtSim2cR53vqTTcagWVAx2L nZeQzenQiV4D/2pvK6dwoTj5ioAlQt7YgFhFyCcXoNYDYBNQIKuIBWhUkgZteVro iF3R2LQ8cHNSe8HSPJIsFLd15J/S74kI0Okl1w2pSHTH5Bp4aoat5hkBMQpoaLAd Kg8vl+6tnrf3HgfbXNg8lJ9wfZLREUFeHaBsP9MpUyi/AMHfHzk9fTFl =WYF1 -----END PGP SIGNATURE----- --=-SjHDEQ4C40UAPsqnR/6n--