Subject | Re: [ib-support] Firebird mention |
---|---|
Author | Adrian Roman |
Post date | 2002-07-29T17:58:03Z |
Hi,
Yes, it's about tables... My mistake.
I never worked with Postgres. I looked over it a while ago, and that's it.
I made a confusion with Oracle. There is there a thing named "Data
Cartridge" which allows defining structures (objects) and even methods for
them, and also allows inheritance.
Nevertheless, I think this is useless from relational point of view. A field
should contain an atomic piece of information.
The same goes for deriving tables. Why you should derive a table?
You can use a table for extension and a view for the derived table that
joins the table from which you want to derive and the extension to obtain
the inherited table, but I don't see why one would want to use object
oriented programming in databases.
OO programming and relational databases are not comparable. In object
oriented programming you have classes, which would be table metadata for
databases, and instances, which would be the real tables in databases. In OO
programming objects are created/destroyed all the time, in databases the
tables tend to stay as they are.
If you really want to simulate inheritance, you always can always use views.
Just create tables that would represent the bottom level in the inheritance
chain, and use views for upper levels.
Adrian Roman
Yes, it's about tables... My mistake.
I never worked with Postgres. I looked over it a while ago, and that's it.
I made a confusion with Oracle. There is there a thing named "Data
Cartridge" which allows defining structures (objects) and even methods for
them, and also allows inheritance.
Nevertheless, I think this is useless from relational point of view. A field
should contain an atomic piece of information.
The same goes for deriving tables. Why you should derive a table?
You can use a table for extension and a view for the derived table that
joins the table from which you want to derive and the extension to obtain
the inherited table, but I don't see why one would want to use object
oriented programming in databases.
OO programming and relational databases are not comparable. In object
oriented programming you have classes, which would be table metadata for
databases, and instances, which would be the real tables in databases. In OO
programming objects are created/destroyed all the time, in databases the
tables tend to stay as they are.
If you really want to simulate inheritance, you always can always use views.
Just create tables that would represent the bottom level in the inheritance
chain, and use views for upper levels.
Adrian Roman
> No, it's not about types, it's about tables. A table can be inherited fromprimary
> another table which means that the new table inherits fields and the
> key. More precise, the primary key is the same for the base table as for
> inherited ones.
>
> Raul.