Re: Problem between inheritance and references - Mailing list pgsql-general

From Stephane Bortzmeyer
Subject Re: Problem between inheritance and references
Date
Msg-id 20020724121405.GA10412@nic.fr
Whole thread Raw
In response to Re: Problem between inheritance and references  (Curt Sampson <cjs@cynic.net>)
List 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 by date:

Previous
From: Elielson Fontanezi
Date:
Subject: Postgres enviroment variable
Next
From: Stephane Bortzmeyer
Date:
Subject: Re: Problem between inheritance and references