CREATE TABLE Authentication ( id SERIAL); -- CREATE TABLE Mail_addresses No! Too weak. CREATE TABLE Passwords ( password TEXT NOT NULL ) INHERITS (Authentication); CREATE TABLE GPGkeys ( pubkey TEXT NOT NULL ) INHERITS (Authentication); CREATE TABLE X509certificates ( certificate TEXT NOT NULL ) INHERITS (Authentication); CREATE TABLE Users ( id SERIAL, name TEXT UNIQUE NOT NULL, authentication TEXT CHECK (authentication IN ('GPG', 'X509', 'password')), auth_info INTEGER REFERENCES Authentication (id)); INSERT INTO Passwords (password) VALUES ('trustnoone'); INSERT INTO Users (name, authentication, auth_info) VALUES ('foobar', 'password', 1);