Return-Path: postarch
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA25488; Sun, 5 Jul 92 12:01:06 -0700
Message-Id: <9207051901.AA25488@postgres.Berkeley.EDU>
From: postarch (Postgres Mailing Archive)
Subject: Re: question
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Reply-To: mer@postgres.berkeley.edu
In-Reply-To: Your message of "Tue, 16 Jun 92 13:27:02 +0600."
             <9206161132.AA15569@postgres.Berkeley.EDU> 
Date: Sun, 05 Jul 92 12:00:38 PDT

you write:

> 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 ?

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.

> 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?

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

> 3. Can You send me some more information about handling Large
>    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
mer@postgres.berkeley.edU
