inherit 5.41 KB
Newer Older
Bruce Momjian's avatar
Bruce Momjian committed
1 2 3 4
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)
Bruce Momjian's avatar
Bruce Momjian committed
5
Received: from hub.org (hub.org [209.167.229.1]) by renoir.op.net (o1/$Revision: 1.8 $) with ESMTP id WAA18944 for <maillist@candle.pha.pa.us>; Tue, 1 Jun 1999 22:08:09 -0400 (EDT)
Bruce Momjian's avatar
Bruce Momjian committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
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)
	(envelope-from owner-pgsql-hackers@postgreSQL.org)
X-Authentication-Warning: hub.org: majordom set sender to owner-pgsql-hackers@postgreSQL.org using -f
Received: from localhost.localdomain (h246.ozemail2.ozemail.com.au [203.108.14.246])
	by hub.org (8.9.3/8.9.3) with ESMTP id WAA75452
	for <pgsql-hackers@hub.org>; Tue, 1 Jun 1999 22:00:50 -0400 (EDT)
	(envelope-from chris.bitmead@bigfoot.com)
Received: from bigfoot.com (localhost [127.0.0.1])
	by localhost.localdomain (8.8.7/8.8.7) with ESMTP id KAA04059
	for <pgsql-hackers@hub.org>; Wed, 2 Jun 1999 10:50:11 +1000
Message-ID: <37547FC3.40106A5E@bigfoot.com>
Date: Wed, 02 Jun 1999 10:50:11 +1000
From: Chris Bitmead <chris.bitmead@bigfoot.com>
X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.2.6 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: pgsql-hackers@hub.org
Subject: Re: [HACKERS] ALTER TABLE ADD COLUMN
References: <199906011436.KAA23479@candle.pha.pa.us>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org
Precedence: bulk
Status: RO

Bruce Momjian wrote:

> Our TODO now has:
> 
>         * 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.


Bruce Momjian's avatar
Bruce Momjian committed
67 68 69 70
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)
Bruce Momjian's avatar
Bruce Momjian committed
71
Received: from hub.org (hub.org [209.167.229.1]) by renoir.op.net (o1/$Revision: 1.8 $) with ESMTP id DAA10238 for <maillist@candle.pha.pa.us>; Fri, 9 Jul 1999 03:56:46 -0400 (EDT)
Bruce Momjian's avatar
Bruce Momjian committed
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
Received: from hub.org (hub.org [209.167.229.1])
	by hub.org (8.9.3/8.9.3) with ESMTP id DAA79895;
	Fri, 9 Jul 1999 03:53:13 -0400 (EDT)
	(envelope-from owner-pgsql-general@hub.org)
Received: by hub.org (TLB v0.10a (1.23 tibbs 1997/01/09 00:29:32)); Fri, 09 Jul 1999 03:47:45 +0000 (EDT)
Received: (from majordom@localhost)
	by hub.org (8.9.3/8.9.3) id DAA79076
	for pgsql-general-outgoing; Fri, 9 Jul 1999 03:47:43 -0400 (EDT)
	(envelope-from owner-pgsql-general@postgreSQL.org)
X-Authentication-Warning: hub.org: majordom set sender to owner-pgsql-general@postgreSQL.org using -f
Received: from ns.idianet.net ([195.154.201.1])
	by hub.org (8.9.3/8.9.3) with ESMTP id DAA79054
	for <pgsql-general@postgreSQL.org>; Fri, 9 Jul 1999 03:47:37 -0400 (EDT)
	(envelope-from haj@idianet.net)
Received: from kosovo (ppp150-paris2.isdnet.net [194.149.182.150])
	by ns.idianet.net (8.9.1/8.9.1) with SMTP id JAA08143;
	Fri, 9 Jul 1999 09:43:35 +0200 (CEST)
Message-ID: <000c01bec9df$3704bd20$0601a8c0@kosovo.idianet.net>
Reply-To: "Jonathan davis" <haj@idianet.net>
From: "Jonathan davis" <haj@idianet.net>
To: "Bruce Momjian" <maillist@candle.pha.pa.us>
Cc: "Pgsql-General@Postgresql. Org" <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] just little BUG
Date: Fri, 9 Jul 1999 09:46:42 +0200
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Sender: owner-pgsql-general@postgreSQL.org
Precedence: bulk
Status: ROr



>[Charset iso-8859-1 unsupported, filtering to ASCII...]
>> hello all
>> 
>> normaly a UNIQUE PRIMARY KEY is unique but 
>> when you use a heritage, you can insert a duplicate key !!!!
>
>I assume you mean inheritance.
>
>Can you send us a little test sample please? 
>
>-- 
hello all

this is the problem:

example:

test=> CREATE TABLE MAN(name char(10) UNIQUE PRIMARY KEY);T

test=> CREATE TABLE PROFESSOR(scool char(20))INHERITS(MAN);

test=> INSERT INTO PROFESSOR(name) VALUES('DAVIS');
INSERT 54424 1

test=> INSERT INTO PROFESSOR(name) VALUES('DAVIS');
INSERT 54425 1