Subject: Simple arrays

From: [email-masked] (Philip Saysell)
Date: Wed, 7 Sep 94 02:23:06 NZS

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: [email-masked]
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 "[email-masked]"

   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================