not null across multiple columns

From: Matthew Terenzio <matt(at)jobsforge(dot)com>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: not null across multiple columns
Date: 2006-11-03 00:10:41
Message-ID: afe02ecbf4cba22a174b9d30a1c4d2aa@jobsforge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


here is an interesting question (to me)

suppose you wanted to be certain that either one of two or more columns
were present

Like in a user table, either a username or an email need to be present
to create a row.

You can't use not null because it's an either or situation.

what's the best method to accomplish this sort of constraint?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message George Pavlov 2006-11-03 00:26:20 Re: not null across multiple columns
Previous Message Mike G 2006-11-02 23:24:48 Cannot rename file pg_xlog\0000.....