Return-Path: owner-postman Received: from LOCALHOST (LOCALHOST [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id VAA06802 for postgres-redist; Wed, 25 May 1994 21:28:45 -0700 Resent-From: POSTGRES mailing list Resent-Message-Id: <199405260428.VAA06802@nobozo.CS.Berkeley.EDU> X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host LOCALHOST didn't use HELO protocol Sender: owner-postman@postgres.Berkeley.EDU X-Return-Path: owner-postman Received: from cs.mtu.edu (cs.mtu.edu [141.219.150.12]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id VAA06792 for ; Wed, 25 May 1994 21:28:43 -0700 Received: from werner.mtu.edu (werner.cs.mtu.edu) by cs.mtu.edu (4.1/SMI-4.1) id AA02346; Thu, 26 May 94 00:28:46 EDT From: aataneja@cs.mtu.edu (Bruce Taneja.) Message-Id: <9405260428.AA02346@cs.mtu.edu> Subject: complex data types .. To: postgres@postgres.Berkeley.EDU Date: Thu, 26 May 1994 00:28:45 -0400 (EDT) Cc: aataneja@cs.mtu.edu (Bruce Taneja.) X-Mailer: ELM [version 2.4 PL22] Content-Type: text Content-Length: 1447 Resent-To: postgres-redist@postgres.Berkeley.EDU Resent-Date: Wed, 25 May 94 21:28:45 -0700 Resent-XMts: smtp Is there a way to call the user-defined-data-type functions in the data types that use those simpler data types .. ;=) example follows: ****************** /* from pyramid.c A pyramid is constructed out of a base circle and a point at certain height above the center of the circle */ ****************** typedef struct{ CIRCLE c; double height; } PYRAMID; ****************** /* intended input format: create table-x (pyramid1 = pyramid) \g append to table-x (pyramid1 = "(2, (3.0, 1.1, 2.1))" ) please doing worry about syntax errors ;), following is the crux: */ ****************** PYRAMID pyramid_in (str) char * str { pyramid * result ; /* BLAH - BLAH parser */ result->height = atof (etc "2"); ****************** /* *** now how in the world do I call the circle_in function (parser) here and let it parse the rest of the "(3.0, 1.1, 2.1)" from above append .. One simple way would be to go result->c.center.x= .. , result->c.radius=... etc but I do NOT want to do this .. !! .. knowing some way of calling parsers from sub-data-types will help tremendously parsing data at higher level of nestings .. */ ****************** Q.2 does some body know at how many nested levels of complex data types does postgres becomes unstable ... ????? Q.3 Can we use nested structs within a single new-data.c file (like circle.c) ****************** thanks a lot folks for listening in, hope u know more that I do ! Bruce! ============================================================================== 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. ==============================================================================