postgresql Creating children tables


Example

CREATE TABLE users (username text, email text);
CREATE TABLE simple_users () INHERITS (users);
CREATE TABLE users_with_password (password text) INHERITS (users);

Our three tables look like this:

users

ColumnType
usernametext
emailtext

simple_users

ColumnType
usernametext
emailtext

users_with_password

ColumnType
usernametext
emailtext
passwordtext