Re: Changing column modifiers?

From: Arne Weiner <aswr(at)gmx(dot)de>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Changing column modifiers?
Date: 2001-09-10 09:06:08
Message-ID: 3B9C8280.E36F9986@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


It seems that it is not possible to alter column constraints and
table constraints do not include NOT NUL.
But you can use CHECK as workaround:

ALTER TABLE authors ADD CHECK (NOT authorfirstname = NULL);

Arne.

Tim Boring wrote:
>
> 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?
>
> Any help/suggestions are appreciated.
>
> Thanks,
> Tim
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Henshall, Stuart - WCP 2001-09-10 12:44:10 Re: FINAL: Multi-User PostgreSQL usage SECURITY
Previous Message Egon Reetz 2001-09-10 08:49:04 Books