Subject: Extending the database with procedures

From: [email-masked] (Mark Davisson)
Date: Tue, 11 Jan 94 23:36:17 CST

I have been trying to define an attribute to contain a function but when
I use the procedure declaration (which is described in the documentation)
it says that procedure is an unknown type.  SO, I saw the regproc in the
built in types and used it to create a class as follows:
        create COMP (id=int4,
        code=char16,
        name=text,
        address=regproc,
        insurer=int4,
        contact=text,
        agent_id=int4,
        fax=int4,
        comments=text,
        descript=int4,
        date=tinterval,
        effect=int4)
then I created an address class so multiple objects can share the same class
without having to have the address imbedded in the object itself:
        reate ADDRESS (id=int4,
        id2=int4, 
        street=text, 
        street2=text, 
        city=text, 
        state=text, 
        zip=int4, 
        phone=int4)
Next, I appended some data into the COMP class, one of which is a function:
append COMP(id=1,
        name="HAP",
        address="retrieve (ADDRESS.all) where ADDRESS.id = 1)
Next, I threw some stuff in the ADDRESS class:
	append ADDRESS(id=1, street="123 COLDBROOK")
Now I should be able to do something like this to get the newly appended
address (let's assume I actually put useful data in the empty slots):
	retrieve (ADDRESS.all) where COMP.address.street = "123 COLDBROOK"
When I do this, however, it says that street is not a defined attribute.  Am
I missing some fundamental principle here (regproc is not the same idea as
the procedure declaration, etc.)  I have looked at Berkeley trying to find
some more documentation on the procedure declaration but the only thing I
found was Stonebrakers "Extending the database with procedures" that had
'procedure' as a type to use in the create statement.
Sorry so long but I wanted to give a concrete example.  Thanks for listening
and I look forward to hearing from someone.

Mark Davisson
[email-masked]

---

From: "Caroline M. Paxson" <[email-masked]>
Date: Wed, 12 Jan 1994 12:24:27 -0800

Hi,
You write about wanting to define a procedure as an attribute.
I'm working on this implementation right now - so what you tried
to do just doesn't work yet.

By the way, you can't take all of the Postgres academic papers as gospel
as to what Postgres can do.  Postgres implementation goals have changed a
lot over the years.  The most trustworthy source of what Postgres really
does at any point in time is the reference manual which comes with the
source.

Carol Paxson
Postgres group, U.C. Berkeley