Re: postgreSQL as deductive DBMS

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Dmitriy Letuchy <dm(dot)l(at)mail(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: postgreSQL as deductive DBMS
Date: 2005-05-16 15:46:21
Message-ID: 20050516154621.GA11562@1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Having written my thesis about deductive DBS I cannot resist giving my 2
cent.

On Mon, May 16, 2005 at 01:42:24PM +0400, Dmitriy Letuchy wrote:
> Now some words about what must be done to realize described feature. The simple quickest way but the way without future is to write language handler. Other more correct way is to slightly extend DML part of SQL and more essentially extend DDL. For example, we have relation Inheritance with two attributes ClassID and ParentID. Now we want to define all descendants or all ancestors. For this goal we define predicate inheritance_all with the next two rules (i.e. inverse implications):
>
> inheritance_all(ClassID, ParentID) :- inheritance(ClassID, ParentID);
> inheritance_all(ClassID, ParentID) :- inheritance(ClassID, X),
> inheritance_all(X, ParentID).
>
> We put this rules into database and call, for example, the next SQL commands:
>
> -- find all descendents
> SELECT * FROM ddb_name.inheritance_all(_, _)

How do you plan to execute this statement. As you mentioned above all
logic queries can be rewritten into SQL ones, but you have to find a way
to handle recursion. I would think the best way is to add recursion to
SQL and then completely rewrite the statements.

Also, and that's where it starts to become interesting, how do you plan
to handle negation inside recursion?

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes(at)jabber(dot)org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-05-16 16:12:39 Re: postgreSQL as deductive DBMS
Previous Message Mahmoud Taghizadeh 2005-05-16 14:56:38 farsi faq has not been added yet in website,