pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
class as a table column?
3+ messages / 1 participants
[nested] [flat]

* class as a table column?
@ 1999-07-09 19:31 George Young <gry@ll.mit.edu>
  0 siblings, 0 replies; 3+ messages in thread

From: George Young @ 1999-07-09 19:31 UTC (permalink / raw)
  To: pgsql-sql

[libpq++ with gcc egcs-2.91.66 (egcs-1.1.2 release) on RH linux 5.1
with Postgres 6.5.]

I've seen in the manual that one can create a table with a class/table
as one of the columns, e.g.:

   --set (complex) attribute may be of the same type as the
       --relation being defined (as here) or of a different complex
       --type.  The type must exist in the "pg_type" catalog or be
       --the one currently being defined.
       --
       create table newemp (name text, manager newemp)

and I have been able to do this in psql.

But what does this really mean?  And how does one insert or extract
data from such a column?  And what is it good for?  It seems like
maybe a powerful facility, but I really don't understand it.

Is this sort-of the same as inheriting from that class? 
Does anyone have examples of its use?

Thanks,
	George

George Young,  Rm. L-204		gry@ll.mit.edu
MIT Lincoln Laboratory
244 Wood St.
Lexington, Massachusetts  02420-9108	(781) 981-2756



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* class as a table column?
@ 1999-07-09 20:37 George Young <gry@ll.mit.edu>
  0 siblings, 0 replies; 3+ messages in thread

From: George Young @ 1999-07-09 20:37 UTC (permalink / raw)
  To: pgsql-sql

 
[libpq++ with gcc egcs-2.91.66 (egcs-1.1.2 release) on RH linux 5.1
with Postgres 6.5.]
 
I've seen in the manual that one can create a table with a class/table
as one of the columns, e.g.:
 
   --set (complex) attribute may be of the same type as the
       --relation being defined (as here) or of a different complex
       --type.  The type must exist in the "pg_type" catalog or be
       --the one currently being defined.
       --
       create table newemp (name text, manager newemp)
 
and I have been able to do this in psql.
 
But what does this really mean?  And how does one insert or extract
data from such a column?  And what is it good for?  It seems like
maybe a powerful facility, but I really don't understand it.
 
Is this sort-of the same as inheriting from that class? 
Does anyone have examples of its use?
 
Thanks,
        George
 
George Young,  Rm. L-204                gry@ll.mit.edu
MIT Lincoln Laboratory
244 Wood St.
Lexington, Massachusetts  02420-9108    (781) 981-2756



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* class as a table column
@ 1999-07-09 20:56 George Young <gry@ll.mit.edu>
  0 siblings, 0 replies; 3+ messages in thread

From: George Young @ 1999-07-09 20:56 UTC (permalink / raw)
  To: pgsql-sql

[libpq++ with gcc egcs-2.91.66 (egcs-1.1.2 release) on RH linux 5.1
with Postgres 6.5.]
 
I've seen in the manual that one can create a table with a class/table
as one of the columns, e.g.:
 
   --set (complex) attribute may be of the same type as the
       --relation being defined (as here) or of a different complex
       --type.  The type must exist in the "pg_type" catalog or be
       --the one currently being defined.
       --
       create table newemp (name text, manager newemp)
 
and I have been able to do this in psql.
 
But what does this really mean?  And how does one insert or extract
data from such a column?  And what is it good for?  It seems like
maybe a powerful facility, but I really don't understand it.
 
Is this sort-of the same as inheriting from that class? 
Does anyone have examples of its use?
 
Thanks,
        George
 
George Young,  Rm. L-204                gry@ll.mit.edu
MIT Lincoln Laboratory
244 Wood St.
Lexington, Massachusetts  02420-9108    (781) 981-2756



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1999-07-09 20:56 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-07-09 19:31 class as a table column? George Young <gry@ll.mit.edu>
1999-07-09 20:37 class as a table column? George Young <gry@ll.mit.edu>
1999-07-09 20:56 class as a table column George Young <gry@ll.mit.edu>

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