| Start | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Creating children tables Our three tables look like this: users
simple_users
users_with_password
|
||||||||||||||||||||||
| Altering tables Let's create two simple tables: Adding columnssimple_users
Adding the same column to the parent table will merge the definition of both columns: NOTICE: merging definition of column "password" for child "simple_users" Dropping columnsUsing our altered tables: users
simple_users
Since we first added the column to Now if we had another child table, its RemarksAn explanation as to why you would want to use inheritance in PostgreSQL is available here: http://stackoverflow.com/a/3075248/653378 (opens new window) |
Read Article
https://develop.horje.com/learn/1434/reference