pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Richards <miker@scifair.acadiau.ca>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-bugs@postgresql.org
Subject: Re: [BUGS] Running queries on inherited tables
Date: Sun, 12 Sep 1999 13:07:37 -0400
Message-ID: <2894.937156057@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.BSF.4.10.9909121328100.61970-100000@scifair.acadiau.ca>

Michael Richards <miker@scifair.acadiau.ca> writes:
> I was fooling with inheritance today. From the page at:
> http://www.postgresql.org/docs/user/inherit.htm
> Here the * after cities indicates that the query should be run over cities
> and all classes below cities in the inheritance hierarchy. Many of the
> commands that we have
> already discussed -- SELECT, UPDATE and DELETE -- support this * notation,
> as do others, like ALTER TABLE. 

The doc is wrong here --- UPDATE and DELETE don't support *.  They should.

> More playing followed... If I alter table on cities and add a column, is
> it not expected that the additional col should appear in the tables which
> inherit from cities?

You have to say "alter table cities*", I believe, otherwise only cities
is changed.  Which is pretty broken --- if inheritance means anything,
then it ought to mean that the alteration is *inherently* applied to all
the child tables too, and you shouldn't have the option.  In general,
however, beware that alteration of inheritance structures is pretty
thoroughly broken --- see various complaints in the pghackers archives
(mostly from Chris Bitmead, I think).  ALTER TABLE really needs a
reimplementation from the ground up, but I dunno when anyone will get
around to it.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <2894.937156057@sss.pgh.pa.us>
Permalink:  ../2894.937156057@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2894.937156057@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, miker@scifair.acadiau.ca, pgsql-bugs@postgresql.org
  Subject: Re: [BUGS] Running queries on inherited tables
  In-Reply-To: <2894.937156057@sss.pgh.pa.us>
  References: <Pine.BSF.4.10.9909121328100.61970-100000@scifair.acadiau.ca> <2894.937156057@sss.pgh.pa.us>

* 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