pg.ddx.io postgres@postgres.berkeley.edu mailing list archive
help / color / mirror / Atom feedTo: postgres@postgres.berkeley.edu
Subject: Re: question
Date: Sun, 05 Jul 92 12:00:38 PDT
Message-ID: <9207051901.AA25488@postgres.Berkeley.EDU> (raw)
In-Reply-To: <9206161132.AA15569@postgres.Berkeley.EDU>
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
view thread (5+ messages) latest in thread
Message-ID: <9207051901.AA25488@postgres.Berkeley.EDU>
Permalink: ../9207051901.AA25488@postgres.Berkeley.EDU/
Also on: postgresql.org/message-id/9207051901.AA25488@postgres.Berkeley.EDU
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: legacy@postgresql.org
Cc: postgres@postgres.berkeley.edu
Subject: Re: question
In-Reply-To: <9207051901.AA25488@postgres.Berkeley.EDU>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox