Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Location
    Sydney
    Posts
    2

    Unanswered: What is object in DB

    I'm new to PostgreSQL object relational DB.

    What does the object mean?

    How does it provide support to object-oriental languages such as C++?

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    I'm not sure where you're quoting that statement from, but, PostgreSQL is an object oriented database.

    For instance, suppose I create a table called video for a movie rental business:
    Code:
    create table video
    (
    video_id characters(8) primary key,
    title varchar(80),
    duration interval
    )
    Then, I create a table for dvds:
    Code:
    Create Table dvds
    (
    region_id integer,
    audio_tracks varchar[]
    ) INHERITS ( video )
    Now, I also create a table called tapes...
    Code:
    Create Table tapes () INHERITS Video
    Tapes inherits all the fields from video.

    dvds inherits all the fields from video, but, it also adds additional specific fields that are pertinent to dvd's

    I could insert a star wars dvd into the dvd table. To populate all the fields, I would need to supply all the fields from video, AND the dvd-specific fields as well. I could insert a tape into the tapes table, only supplying the ID, title, and and duration fields.

    Then, if I select from either table, I would only see the one entry per table. However, I could SELECT * from VIDEO, and see the common data for both movies.
    Last edited by loquin; 07-31-06 at 14:53.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Jul 2006
    Location
    Sydney
    Posts
    2
    Thanks for your reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •