pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: missive@frontiernet.net
To: pgsql-admin@postgresql.org
Subject: Re: Changing column modifiers?
Date: Tue, 11 Sep 2001 00:27:17 +0000 (UTC)
Message-ID: <9njlp5$219s$1@news.tht.net> (raw)
References: <1000084115.4120.2.camel@tim>

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.




view thread (4+ messages)  latest in thread

Message-ID: <9njlp5$219s$1@news.tht.net>
Permalink:  ../9njlp5$219s$1@news.tht.net/
Also on:    postgresql.org/message-id/9njlp5$219s$1@news.tht.net

 · 

reply

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: missive@frontiernet.net
  Subject: Re: Changing column modifiers?
  In-Reply-To: <9njlp5$219s$1@news.tht.net>
  References: <1000084115.4120.2.camel@tim> <9njlp5$219s$1@news.tht.net>

* 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