Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id LAA14011 for postgres-redist; Thu, 15 Dec 1994 11:01:02 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199412151901.LAA14011@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from twinkie.cs.UMD.EDU (twinkie.cs.umd.edu [128.8.126.25]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with ESMTP id LAA14001 for <postgres@postgres.berkeley.edu>; Thu, 15 Dec 1994 11:01:00 -0800
From: kilin@cs.UMD.EDU
Received: by twinkie.cs.UMD.EDU (8.6.9/UMIACS-0.9/04-05-88)
	id OAA05957; Thu, 15 Dec 1994 14:00:58 -0500
Date: Thu, 15 Dec 1994 14:00:58 -0500
Message-Id: <199412151900.OAA05957@twinkie.cs.UMD.EDU>
To: postgres@postgres.Berkeley.EDU
Subject: Incorporating new access methods / polygons
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Thu, 15 Dec 94 11:01:02 -0800
Resent-XMts: smtp


Hello

I am working on adding additional spatial access method on Postgres and
have been trying to understand various source (like the source code and
pg.am -- thank for Paul Brown for that tip). 

Two questions:

(A) Suppose I have a new access method code written. Assume say, I just
    copy the R-tree code and renaming it R2-tree, residing in the
    directory ......./backend/access/index-r2tree. What else do I have
    to do to?

    This is what I think should happen, can anyone point out any mistake?

    (1) Create a Makefile.inc with the following statements:

    .PATH: ${.CURDIR}/access/index-r2tree
    SRCS+= r2tget.c r2tproc.c r2tree.c r2tscan.c r2tstrat.c

    (2) Go to ..../backend/catalog/

    (3) Edit pg_am by adding a DATA statement to insert the access method
        to pg_am  

        DATA(insert OID = 1500 ( r2tree PGUID "o" ...........));
      
        [A unique OID (from ALL other OIDS in other pg files) will be enough, 
         right? Or do the range of OID matters (like I should use 1-10 for 
         some function etc.)?]

    (4) Edit pg_proc by adding a DATA statement to insert each interface
        procedure to pg_proc 

        DATA(insert OID = 1600 ( r2tinsert PGUID "o" ...........));
  
        [We only need to do this for the interface functions, like those
         needed in pg_am, right?]

    (5) Edit pg_amop.h, pg_amproc.h similarly to insert the tuples.

    (6) Edit  ...../backend/utils/builtin.h to include all the function
        headers:
         extern char* r2tinsert(); etc.

    (7) If there is new selectivity functions, incoporate them
        into .../backend/utils/adt/selfuncs.c

    (8) Remake the whole thing (using bmake).

    Anything I missed? Messed up? Any guidelines?

(B) Polygons. The polygon functions seems to be just manipulating 
    bounding boxes. Is it right? Is there a package to allow really
    working with (multiside) polygons?

Hope it's not too long. Thanks a lot in advance.

David Lin
    


==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
