agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedRe: composite objects
3+ messages / 3 participants
[nested] [flat]
* composite objects
@ 1991-06-25 23:31 Gregory Klein <klein@imasun.lbl.gov>
1991-06-25 16:46 ` Re: composite objects Mike Olson <mao@postgres.Berkeley.EDU>
0 siblings, 1 reply; 3+ messages in thread
From: Gregory Klein @ 1991-06-25 23:31 UTC (permalink / raw)
To: legacy
In the Postgres tutorial, the following composite object was defined:
create EMP(name=c12,salary=float8,age=int4,dept=c12,manager=EMP)
and attributes were appended to the object using
append to EMP (name="Sam",salary=1000,age=40,dept="shoe",
manager=mgr-lookup("shoe"))
where mgr-lookup was defined as the function by
define function mgr-lookup(c12) returns EMP as
retrieve (EMP.all) where EMP.name=DEPT.manager and DEPT.name=$1
Since Postgres 2.1 does not appear to be able to define this sort of
function, is there a way to populate composite objects?
Thanks,
Greg Klein
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: composite objects
1991-06-25 23:31 composite objects Gregory Klein <klein@imasun.lbl.gov>
@ 1991-06-25 16:46 ` Mike Olson <mao@postgres.Berkeley.EDU>
0 siblings, 0 replies; 3+ messages in thread
From: Mike Olson @ 1991-06-25 16:46 UTC (permalink / raw)
To: legacy
here's a way to make this happen; how it works should be clear from the
example.
create EMP (name = char16, salary = int4, mgr_name = char16)
define postquel function manager (EMP) returns EMP is
retrieve (e.all) from e in EMP where e.name = current.mgr_name
the 'define postquel function' declares a method on class EMP and adds a
virtual column, 'manager', to the class. this isn't perfect, but will
do what you want at the cost of an additional key stored in each EMP
instance.
mike olson
postgres research group
uc berkeley
mao@postgres.berkeley.edu
^ permalink raw reply [nested|flat] 3+ messages in thread
* Composite Objects
@ 1994-07-13 12:13 Paul Waine <P.Waine1@lut.ac.uk>
0 siblings, 0 replies; 3+ messages in thread
From: Paul Waine @ 1994-07-13 12:13 UTC (permalink / raw)
To: legacy
Hi,
I was wondering what the situation was with regard to composite object
in version 4.2. Are they still supported via function definition or can they
be directly specified ? Is the situation the same with Illustra ?
Thanks in Advance
Paul
+--------------------------------------------------------------------+
|Paul Waine E-mail P.Waine1@lut.ac.uk |
|Department of Manufacturing Engineering |
|University of Technology, Loughborough, Leics, LE11 3UE, UK |
+--------------------------------------------------------------------+
==============================================================================
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.
==============================================================================
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~1994-07-13 12:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1991-06-25 23:31 composite objects Gregory Klein <klein@imasun.lbl.gov>
1991-06-25 16:46 ` Mike Olson <mao@postgres.Berkeley.EDU>
1994-07-13 12:13 Composite Objects Paul Waine <P.Waine1@lut.ac.uk>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox