FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.26k stars 216 forks source link

Extend CREATE TABLE to support Inheritance [CORE987] #1394

Open firebird-automations opened 18 years ago

firebird-automations commented 18 years ago

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 commented 16 years ago
Modified by: @pcisar Workflow: jira \[ 11299 \] =\> Firebird \[ 15017 \]
firebird-automations commented 16 years ago

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 commented 14 years ago

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 commented 13 years ago

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 commented 10 years ago
Modified by: Sean Leyne (seanleyne) summary: Inherited tables =\> Extend CREATE TABLE to support table Inheritance
firebird-automations commented 10 years ago
Modified by: Sean Leyne (seanleyne) summary: Extend CREATE TABLE to support table Inheritance =\> Extend CREATE TABLE to support Inheritance