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 HAA05290 for postgres-redist; Tue, 6 Sep 1994 07:21:36 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199409061421.HAA05290@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 CANTVA.CANTERBURY.AC.NZ (cantva.canterbury.ac.nz [132.181.30.3]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with ESMTP id HAA05280 for <postgres@postgres.berkeley.edu>; Tue, 6 Sep 1994 07:21:33 -0700
Received: from cosc.canterbury.ac.nz by csc.canterbury.ac.nz
 (PMDF V4.3-10 #7295) id <01HGTBVMBPS0FGVZ4A@csc.canterbury.ac.nz>; Wed,
 07 Sep 1994 02:21:22 +1200
Received: from kiwi.cosc.canterbury.ac.nz by cosc.canterbury.ac.nz
 (4.1/SMI-4.0) id AA03972; Wed, 7 Sep 94 02:23:06 NZS
Date: Wed, 7 Sep 94 02:23:06 NZS
From: phil@cosc.canterbury.ac.nz (Philip Saysell)
Subject: Simple arrays
To: postgres@postgres.Berkeley.EDU
Message-id: <9409061423.AA03972@cosc.canterbury.ac.nz>
X-Envelope-to: postgres@postgres.berkeley.edu
Content-transfer-encoding: 7BIT
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Tue, 06 Sep 94 07:21:36 -0700
Resent-XMts: smtp

Suppose I have a simple array of integers defined as a type, such as
* define type int_array (element = int4, internallength = variable,
  input = array_in, output = array_out)
and I have a class set up which includes this type, such as
* create test (id = int4, array = int_array)
then can I do a 'retrieve from test' where the value, say 5, is in the
array, at an unspecified position?

What I am looking at is something like
* retrieve (test.all) where 5 is in test.array

Is this possible without having to use define operators, and loading
C functions, etc?  I have been working on the C functions for this
task for the last few days, but I am running into problems with 'link
failed!' errors when loading the C file, and not knowing the structure
of the array when it is recieved.

I am using version 4.1 of Postgres.

I have tried unsuccessfully to create a new array type using the example
of stats in section 8.5.3 of The Postgres User Manual, version 4.1
However this example is incomplete, and appears to contain some errors
(compiler does not like the `arrayp = &(stats->bytes[0]);' line, and
should it not be 'char *s' instead of 'char s' in line 3?)

Any help would be much appreciated.

Thanks,

Phil

-------------------------------------------------------------------------
Phil Saysell                     |   Home:       +64 3 358 2214
Honours Student                  |   University: +64 3 364 2555
Department of Computer Science   |   Internal:   Extention 6555
University of Canterbury         |   E-Mail: Phil@cosc.canterbury.ac.nz
CHRISTCHURCH                     |   Post:   20 Oakfield St, Burnside
NEW ZEALAND                      |            CHRISTCHURCH 5, NEW ZEALAND
-------------------------------------------------------------------------


==============================================================================
   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.
==============================================================================
