Re: Changing column modifiers?

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Changing column modifiers?
Date: 2001-09-11 00:27:17
Message-ID: 9njlp5$219s$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, 10 Sep 2001 01:25:59 +0000 (UTC), Tim Boring <tboring(at)insight(dot)rr(dot)com>:
> Can you change a column modifier after you've created the table? For
> example, I have a table called "authors" with the following columns:
> authorid, authorfirstname, authorlastname, authormi, statecode, country,
> born, deceased.
>
> When I created the table, I forgot to make the "authorfirstname" and
> "authorlastname" columns NOT NULL. I've looked at ALTER TABLE but I
> don't see a way to use it to add NOT NULL...maybe I'm just missing the
> obvious?
>

How about creating a new table as you like it, then
selecting the data from the old table into the new one
dropping the old table and renaming the new one?

Roundabout, but might be useful.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Henshall, Stuart - WCP 2001-09-11 08:47:02 Re: Changing column modifiers?
Previous Message Oliver Elphick 2001-09-10 21:03:34 Re: Can't discover database size