From: Nick Fankhauser <nickf@ontko.com>
To: MG <makgab@freemail.hu>
To: PostgreSQL List <pgsql-admin@postgresql.org>
Subject: Re: ALTER TABLE for field modify...
Date: Fri, 3 May 2002 14:07:32 -0500
Message-ID: <NEBBLAAHGLEEPCGOBHDGIEGLEOAA.nickf@ontko.com> (raw)
In-Reply-To: <XFMail.20020502222731.makgab@freemail.hu>
alter table <tablename> drop constraint ID unique;
alter table <tablename> drop constraint ID not null;
alter table <tablename> add constraint ID references table2 ;
Here is where you can find the documentation for this:
The "alter":
http://www.postgresql.org/idocs/index.php?sql-altertable.html
The constraints:
http://www.postgresql.org/idocs/index.php?sql-createtable.html
regards,
-Nick
--------------------------------------------------------------------------
Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org
> [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of MG
> Sent: Thursday, May 02, 2002 3:28 PM
> To: PostgreSQL List
> Subject: [ADMIN] ALTER TABLE for field modify...
>
>
>
> Hi!
>
> How can I modify a field of table with ALTER TABLE? I want to modify the
> constraint. The TABLE is now:
> "ID" int8 NOT NULL, UNIQUE
>
> But I want this:
> "ID" int8 REFERENCE "table2"
>
>
> THanx!
> Bye!
> -----------------
> Linux RedHat 7.1
> -----------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
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: nickf@ontko.com, makgab@freemail.hu
Subject: Re: ALTER TABLE for field modify...
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGIEGLEOAA.nickf@ontko.com>
References: <XFMail.20020502222731.makgab@freemail.hu> <NEBBLAAHGLEEPCGOBHDGIEGLEOAA.nickf@ontko.com>
* 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