From owner-pgsql-hackers@hub.org Tue Jun 1 22:31:18 1999
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id WAA09988
for <maillist@candle.pha.pa.us>; Tue, 1 Jun 1999 22:31:17 -0400 (EDT)
Received: from hub.org (hub.org [209.167.229.1]) by renoir.op.net (o1/$ Revision: 1.18 $) with ESMTP id WAA18944 for <maillist@candle.pha.pa.us>; Tue, 1 Jun 1999 22:08:09 -0400 (EDT)
Received: from hub.org (hub.org [209.167.229.1])
by hub.org (8.9.3/8.9.3) with ESMTP id WAA75604;
Tue, 1 Jun 1999 22:01:31 -0400 (EDT)
(envelope-from owner-pgsql-hackers@hub.org)
Received: by hub.org (TLB v0.10a (1.23 tibbs 1997/01/09 00:29:32)); Tue, 01 Jun 1999 22:01:11 +0000 (EDT)
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id WAA75519
for pgsql-hackers-outgoing; Tue, 1 Jun 1999 22:01:09 -0400 (EDT)
> * ALTER TABLE ADD COLUMN to inherited table put column in wrong place
>
> I don't think any of us understand the issues on this one.
Let me guess at the problem. When you add a column, it doesn't change
all the records, therefore the column must be added at the end. This
means that the columns will not be in the same order as if you had
created them from scratch.
There seem to be three solutions:
a) Go to a much more sophisticated schema system, with versions and
version numbers (fairly hard but desirable to fix other schema change
problems). Then insert the column in the position it is supposed to be
in.
b) Fix the copy command to input and output the columns, not in the
order they are in, but in the order they would be in on re-creation.
c) make the copy command take arguments specifying the field names, like
INSERT can do.
I think it would be good if Postgres had all 3 features. Probably (b) is
the least work.
From owner-pgsql-general@hub.org Fri Jul 9 04:01:16 1999
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id EAA22565
for <maillist@candle.pha.pa.us>; Fri, 9 Jul 1999 04:01:15 -0400 (EDT)
Received: from hub.org (hub.org [209.167.229.1]) by renoir.op.net (o1/$ Revision: 1.18 $) with ESMTP id DAA10238 for <maillist@candle.pha.pa.us>; Fri, 9 Jul 1999 03:56:46 -0400 (EDT)
Does the following indicate a bug? It sure is wierd. Maybe some of these
statements aren't supported by postgresql (??), but the outcome doesn't
make sense to me.
httpd=> CREATE TABLE x (y text);
CREATE
httpd=> CREATE VIEW z AS select * from x;
CREATE
httpd=> CREATE TABLE a (b text) INHERITS(z);
CREATE
httpd=> INSERT INTO x VALUES ('foo');
INSERT 168602 1
httpd=> select * from z*;
y
---
foo
foo
(2 rows)
How did we suddenly get two rows??
--
Chris Bitmead
http://www.bigfoot.com/~chris.bitmead
mailto:chris.bitmead@bigfoot.com
From owner-pgsql-hackers@hub.org Tue May 25 11:01:16 1999
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id LAA15867
for <maillist@candle.pha.pa.us>; Tue, 25 May 1999 11:01:16 -0400 (EDT)
Received: from hub.org (hub.org [209.167.229.1]) by renoir.op.net (o1/$ Revision: 1.18 $) with ESMTP id KAA10712 for <maillist@candle.pha.pa.us>; Tue, 25 May 1999 10:55:17 -0400 (EDT)
Received: from hub.org (hub.org [209.167.229.1])
by hub.org (8.9.3/8.9.3) with ESMTP id KAA07206;
Tue, 25 May 1999 10:45:50 -0400 (EDT)
(envelope-from owner-pgsql-hackers@hub.org)
Received: by hub.org (TLB v0.10a (1.23 tibbs 1997/01/09 00:29:32)); Tue, 25 May 1999 10:43:02 +0000 (EDT)
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id KAA06706
for pgsql-hackers-outgoing; Tue, 25 May 1999 10:43:01 -0400 (EDT)
> > Everything has its order and it's not like the inheritance as such is
> > broken.
>
> Yes, a whole bunch of stuff is broken after this happens. Go back and
> consult the archives --- or maybe Chris Bitmead will fill you in; he's
> got plenty of scars to show for this set of problems. (All I recall
> offhand is that pg_dump and reload can fail to generate a working
> database.) The bottom line is that it would be a lot nicer if column c
> had the same column position in both the parent table and the child
> table(s).
This should be fixed in pg_dump by infering something via the oids of the
pg_attribute entries. No need to mess up the backend for it.
Maybe pg_dump should optionally dump schemas in terms of insert into
pg_something commands rather than actual DDL. ;)
>
> I suggest you be very cautious about messing with ALTER TABLE until you
> understand why inheritance makes it such a headache ;-)
I'm just trying to get the defaults and constraints working. If
inheritance stays broken the way it previously was, it's beyond my
powers. But I get the feeling that people rather not alter their tables
unless they have *perfect* alter table commands. I don't feel like arguing
with them, they'll just have to do without then.
--
Peter Eisentraut Sernanders vg 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
************
From pgsql-general-owner+M2136@hub.org Sat Jun 3 23:31:02 2000
Received: from renoir.op.net (root@renoir.op.net [207.29.195.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id WAA28683
for <pgman@candle.pha.pa.us>; Sat, 3 Jun 2000 22:31:01 -0400 (EDT)
Received: from news.tht.net (news.hub.org [216.126.91.242]) by renoir.op.net (o1/$Revision: 1.2 $) with ESMTP id WAA20977 for <pgman@candle.pha.pa.us>; Sat, 3 Jun 2000 22:05:07 -0400 (EDT)
Received: from hub.org (majordom@hub.org [216.126.84.1])
by news.tht.net (8.9.3/8.9.3) with ESMTP id VAD35811;
Sat, 3 Jun 2000 21:54:36 -0400 (EDT)
(envelope-from pgsql-general-owner+M2136@hub.org)
Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236])
by hub.org (8.9.3/8.9.3) with ESMTP id VAA12118
for <pgsql-general@postgresql.org>; Sat, 3 Jun 2000 21:41:27 -0400 (EDT)
(envelope-from peter@localhost.its.uu.se)
Received: from regulus.student.UU.SE ([130.238.5.2]:61160 "EHLO
regulus.its.uu.se") by merganser.its.uu.se with ESMTP
id <S168006AbQFDBlC>; Sun, 4 Jun 2000 03:41:02 +0200
Received: from peter (helo=localhost)
by regulus.its.uu.se with local-esmtp (Exim 3.02 #2)
id 12yPV7-0002Tp-00; Sun, 04 Jun 2000 03:46:53 +0200