Re: Problem between inheritance and references

Поиск
Список
Период
Сортировка
От Stephane Bortzmeyer
Тема Re: Problem between inheritance and references
Дата
Msg-id 20020724121405.GA10412@nic.fr
обсуждение исходный текст
Ответ на Re: Problem between inheritance and references  (Curt Sampson <cjs@cynic.net>)
Список pgsql-general
On Wed, Jul 24, 2002 at 11:11:25AM +0900,
 Curt Sampson <cjs@cynic.net> wrote
 a message of 12 lines which said:

> > OK, I see the problem. Any suggestion on how to rephrase my schema
> > (besides dropping inheritance)?
>
> What would be the disadvantage of dropping inheritance, and just
> using standard relational methods (foreign key, join, etc.)?

It's less beautiful :-( Anyway, here is my new schema, which seems to work:

CREATE TABLE Authentication (
  id SERIAL,
  method TEXT NOT NULL CHECK (method IN ('GPG', 'X509', 'password')),
  password TEXT,
  gpgpubkey TEXT,
  certificate TEXT,
  CHECK (password IS NOT NULL OR gpgpubkey IS NOT NULL OR certificate IS NOT NULL));

CREATE TABLE Users (
       id SERIAL,
       name TEXT UNIQUE NOT NULL,
       auth_info INTEGER REFERENCES Authentication (id));


В списке pgsql-general по дате отправления:

Предыдущее
От: Elielson Fontanezi
Дата:
Сообщение: Postgres enviroment variable
Следующее
От: Stephane Bortzmeyer
Дата:
Сообщение: Re: Problem between inheritance and references