Table inheritance or LIKE table? - Mailing list pgsql-general

From Steve - DND
Subject Table inheritance or LIKE table?
Date
Msg-id LDEHKBBOEMIJKHKBOFNFOELONAAA.postgres@digitalnothing.com
Whole thread Raw
Responses Re: Table inheritance or LIKE table?  (Bob Henkel <luckyratfoot@gmail.com>)
List 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 by date:

Previous
From: Brian K Boonstra
Date:
Subject: Note: Compiling on Windows with free Microsoft compilers
Next
From: Bob Henkel
Date:
Subject: Re: Table inheritance or LIKE table?