From: David Stanaway <david@stanaway.net>
To: MG <makgab@freemail.hu>
Cc: PostgreSQL List <pgsql-admin@postgresql.org>
Subject: Re: ALTER TABLE for field modify...
Date: 14 May 2002 15:52:29 -0500
Message-ID: <1021409549.996.2407.camel@ciderbox> (raw)
In-Reply-To: <XFMail.20020506190803.makgab@freemail.hu>
References: <XFMail.20020506190803.makgab@freemail.hu>
On Tue, 2002-05-14 at 11:24, MG wrote:
>
> On 03-May-2002 Nick Fankhauser wrote:
> > alter table <tablename> drop constraint ID unique;
> > alter table <tablename> drop constraint ID not null;
> >
> > alter table <tablename> add constraint ID references table2 ;
> >
>
> Hi!
>
> It not works. :(
> I try it:
> proba=# create table "tabla1" ("ID" int8 NOT NULL UNIQUE, "nev" varchar(20) );
> NOTICE: CREATE TABLE/UNIQUE will create implicit index 'tabla1_ID_key' for
> 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=# create table "tabla2" ("ID2" int8 NOT NULL UNIQUE, "nev2" varchar(20) );
> NOTICE: CREATE TABLE/UNIQUE will create implicit index 'tabla2_ID2_key' for
> table 'tabla2'
> CREATE
>
> proba=# 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
Attachments:
signature.asc (application/pgp-signature, 523B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: david@stanaway.net, makgab@freemail.hu
Subject: Re: ALTER TABLE for field modify...
In-Reply-To: <1021409549.996.2407.camel@ciderbox>
References: <XFMail.20020506190803.makgab@freemail.hu> <1021409549.996.2407.camel@ciderbox>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox