Using "object orientated" tables?

From: Simon Connah <simon(dot)n(dot)connah(at)protonmail(dot)com>
To: pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Using "object orientated" tables?
Date: 2022-05-11 01:33:20
Message-ID: FD4Iyd89i-sbetQTcbUPO1SqWrYMGhzyso4ltpYmvWiI5LtHUxnPZNCyoJOhMOr3aQqvSKR9pISe55L3HStXrim-Q2wuufRQFkjGtAjIyS8=@protonmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I was wondering what the community thought of using table inheritance in PostgreSQL? Is it considered bad practice these days?

Basically, I have a users table and every user has a unique, not null UUID which is used as the primary key. There are only three columns on the table. User ID, Username, Email.

Having said that I'll have to store data about them which I don't want to do in one massive table as it would be ugly as hell. So what I want is my main user's table to stick to three columns and then sub-tables which inherit from it to add their own column? So for instance I might want to store an account balance for people making money on my site.

Hopefully, I've managed to explain what I mean properly. If you need any extra information then let me.

Simon.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message David G. Johnston 2022-05-11 01:43:08 Re: Using "object orientated" tables?
Previous Message Mark Wallace 2022-03-31 08:48:42 Re: ALTER DEFAULT PRIVILEGES