Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend CREATE TABLE to support Inheritance [CORE987] #1394

Open
firebird-automations opened this issue Nov 6, 2006 · 6 comments
Open

Extend CREATE TABLE to support Inheritance [CORE987] #1394

firebird-automations opened this issue Nov 6, 2006 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Dejan Schild (schild)

Votes: 17

It would be very useful to implement this feature, like in PosgreSQL.
Example:
CREATE TABLE cities (
name char(20),
population integer,
altitude integer
);

CREATE TABLE capitals (
state char(2)
) INHERITS (cities);

In this case, the capitals table inherits all the columns of its parent table, cities. State capitals also have an extra column, state, that shows their state.

More on: http://www.postgresql.org/docs/8.1/interactive/ddl-inherit.html

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 11299 ] => Firebird [ 15017 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Cosmin Apreutesei (cosmin_ap2)

I vote for it, just don't do it like Postgres, it's useless without applying constraints on the parent. If done right, this would be a killer feature for firebird.

@firebird-automations
Copy link
Collaborator Author

Commented by: Laszlo Moravecz (eMeL) (emel)

+1

I would like to see it early as soon possible ;)

See how Alex Peshkov plan it: http://www.firebirdnews.org/?p=3830

I think, inherited table must be a view+table hibrid. [A view hide same named table]
When select inherited table it shown as an updateable view (auto collect base+inherited table's data).
When update this table+view combo it updates both (or more) physical table, with triggers too.

@firebird-automations
Copy link
Collaborator Author

Commented by: Marcoci Dorin (marcodor)

+1 This is a very important and long awaited feature.
Please include it in todo list for v3.
Ideal for model to store natural objects.
We have for example ORGANISMS->ANIMALS->QUADRUPEDS->DOGS->ROTTWEILERS.
Every "object" have they own properties and triggers ;)
We use such approach in our accounting software, using views and triggers, but it is a lot of work to code and manage, want it automatically.
OOP is a great idea.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

summary: Inherited tables => Extend CREATE TABLE to support table Inheritance

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

summary: Extend CREATE TABLE to support table Inheritance => Extend CREATE TABLE to support Inheritance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant