Re: Changing column modifiers? - Mailing list pgsql-admin

From missive@frontiernet.net (Lee Harr)
Subject Re: Changing column modifiers?
Date
Msg-id 9njlp5$219s$1@news.tht.net
Whole thread Raw
In response to Changing column modifiers?  (Tim Boring <tboring@insight.rr.com>)
List pgsql-admin
On Mon, 10 Sep 2001 01:25:59 +0000 (UTC), Tim Boring <tboring@insight.rr.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.


pgsql-admin by date:

Previous
From: "Michael Baker"
Date:
Subject: Transaction Aborting on sql call failure
Next
From: "Nick Fankhauser"
Date:
Subject: Can't get postmaster to restart after removing WAL files