Subject: question

From: Carolin Engel <[email-masked]>
Date: Tue, 16 Jun 92 13:27:02 MESZ

Dresden, 15.06.1992

Dear Sirs !

I'm a graduate student at the Technical University Dresden in the
department of databases.
I'm dealing with Yours system POSTGRES, Version 3.0 but I have
some problems:

1. I have defined your example object class "emp":
     emp (name = char16, ..., budget = int4[12]) \g
   (found in the Reference Manual, 1/16/90, Page 18)
   I want to access the first element of vector "budget" addressing
   it with the angular brackets:
     replace emp (budget[1] = 10) \g
   But it come an error message : Syntax error at or near "["
  
   How can I address the i-th element of a vector ?

2. I have defined the following object classes and type:
     create ADDRESS(city = char16, street = char16) \g
     define type T_ADDR (internallength = -1,
                       input = array_in,
                       output = array_out,
                       element = ADDRESS) \g
     create PERSON (name = char16, age = int2, adr = T_ADDR[]) \g

   I want to append data to the object class PERSON so that a
   person can have many different addresses.
   That give a problem because the possibility define an attribute
   as a postquel function described in the article "The POSTGRES
   Data Model" (Page 11)
   (for example: create PERSON (name = char16, adr = postquel)\g)
   and than append data in the form
     append PERSON (name ="Charles", adr ="retrieve (A.all)
                    from A in address where A.city ="Dresden")\g
   is not allowed in Version 3.0.
   The execute-command doesn't work too.

   My question: How can I append values to an object class as
   subobject references from another object class using my class
   and type definition described over?

3. Can You send me some more information about handling Large
   Objects (Large Object Backend Interface)?

Gratefull for Your help !

Carolin Engel

My e-mail-address:
x-400 :   [email-masked]
or UNIX:  [email-masked]

---

From: postarch (Postgres Mailing Archive)
Date: Sun, 05 Jul 92 12:00:38 PDT

>    How can I address the i-th element of a vector ?

You can't in replace statements.  We are working on overcoming the
short comings of arrays.  Currently they are second class citizens
in postgres.  When you want to replace a single element you are forced
to replace the entire array.  That is you have to give the full array
constant as you do in append or copy.

>    and type definition described over?

Unfortunately arrays of complex types are not supported (and won't be
anytime soon).

>    Objects (Large Object Backend Interface)?

The large object interface has changed significantly since version 3.
The version 4.0 docs will have a much description of how to use them and
will be out shortly.

Jeff Meredith
[email-masked]