pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Finding the names of inheriting classes
3+ messages / 2 participants
[nested] [flat]

* Finding the names of inheriting classes
@ 2000-06-28 18:50 Thomas Swan <tswan@olemiss.edu>
  2000-06-29 01:55 ` Re: Finding the names of inheriting classes Tom Lane <tgl@sss.pgh.pa.us>
  2000-06-29 03:54 ` Re: Finding the names of inheriting classes Thomas Swan <tswan@olemiss.edu>
  0 siblings, 2 replies; 3+ messages in thread

From: Thomas Swan @ 2000-06-28 18:50 UTC (permalink / raw)
  To: pgsql-sql@hub.org


This is actually two problems...

I'm at a loss on how identify or get the names of children of a parent class.

For example, I have three children of a parent class Cities : Big_Cities, 
Little_Cities, Not_Cities.   I know that I can do a select * from Cities* 
and get all rows from Cities and Cities' children.

For the first question, is there a way I can get the names of the tables 
(classes) that inherit from a parent class?
For example, getting the names of the tables 
"Big_Cities","Little_Cities",and "Not_Cities" from a statement asking what 
are the children of tables (class) Cities.

The second question revolves around the select * from Cities*.

If Cities has a "name" column and Big_Cities has a "population" column 
added and I do a select * from Cities* the resulting table only has the 
"name" column.  Is there a way to get a table that has all the columns (not 
just the ones in common) and put nulls in the columns for which there is no 
information or data?
-
- Thomas Swan
- ________________________________________
- Graduate Student  - Computer Science
- The University of Mississippi
-
- "People can be sorted into two fundamental groups,
- those that divide people into two groups and
- those that don't."

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

* Re: Finding the names of inheriting classes
  2000-06-28 18:50 Finding the names of inheriting classes Thomas Swan <tswan@olemiss.edu>
@ 2000-06-29 01:55 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2000-06-29 01:55 UTC (permalink / raw)
  To: Thomas Swan <tswan@olemiss.edu>; +Cc: pgsql-sql@hub.org

Thomas Swan <tswan@olemiss.edu> writes:
> I'm at a loss on how identify or get the names of children of a parent class.

Join pg_class against pg_inherits.

			regards, tom lane



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

* Re: Finding the names of inheriting classes
  2000-06-28 18:50 Finding the names of inheriting classes Thomas Swan <tswan@olemiss.edu>
@ 2000-06-29 03:54 ` Thomas Swan <tswan@olemiss.edu>
  1 sibling, 0 replies; 3+ messages in thread

From: Thomas Swan @ 2000-06-29 03:54 UTC (permalink / raw)
  To: pgsql-sql@hub.org


Thanks...

At the same time I had a friend guide me through the system tables... :)
-
- Thomas Swan
- ________________________________________
- Graduate Student  - Computer Science
- The University of Mississippi
-
- "People can be sorted into two fundamental groups,
- those that divide people into two groups and
- those that don't."

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


end of thread, other threads:[~2000-06-29 03:54 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-06-28 18:50 Finding the names of inheriting classes Thomas Swan <tswan@olemiss.edu>
2000-06-29 01:55 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-06-29 03:54 ` Thomas Swan <tswan@olemiss.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