Table inheritance or LIKE table?
От | Steve - DND |
---|---|
Тема | Table inheritance or LIKE table? |
Дата | |
Msg-id | LDEHKBBOEMIJKHKBOFNFOELONAAA.postgres@digitalnothing.com обсуждение исходный текст |
Ответы |
Re: Table inheritance or LIKE table?
|
Список | pgsql-general |
What is the general consensus on using table inheritance? I know it's there, but is it good, bad, or just dependent on how it's used? I need to track creation/update information for a large number of tables in my current DB. I was just going to create a table with the template of fields I was looking for, and use LIKE in the table definition. It turns out that LIKE does not maintain FK constraints, or indexes. Would this be a good situation to use inheritance? Since the data in question is identical for all of the tables it will be used on, it seems like it might be the right path. Are there any performance issues with table inheritance? Below is the DDL for the table in question. CREATE TABLE create_update_info ( created_by_user_id integer NOT NULL, created_on timestamp DEFAULT timezone('UTC', now()) NOT NULL, updated_by_user_id integer NOT NULL, updated_on timestamp DEFAULT timezone('UTC', now()) NOT NULL, FOREIGN KEY (created_by_user_id) REFERENCES users(user_id), FOREIGN KEY (updated_by_user_id) REFERENCES users(user_id) ) Thanks, Steve
В списке pgsql-general по дате отправления: