PostgreSQL as Object Database


This is a live blog (i.e. I’d be updating this post time by time.

I am starting to use PostgreSQL as Object Database, mainly as a part of my course project. Object oriented extension of SQL is quite interesting – I, kinda, am loving it. However, all object oriented extensions are not yet implemented by vendors. PostgreSQL lacks a lot of them. Here, in this post, I am going to put notes about what I encounter.

I am using PostgreSQL v9.3.0.

No type inheritance

I tried to use the cool feature of SQL with the keyword under, which was supposed work like extend keyword for type inheritance. e.g.:

CREATE TYPE StudentType UNDER PersonType AS (
    Id INTEGER,
    Level CHAR(2)
)

However, table inheritance is still available, e.g.:

CREATE TABLE Students(
    Id INTEGER,
    Level CHAR(2)
) INHERITS (Persons);

List all tables

select * from information_schema.tables

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.