From lmpimentel@yahoo.com Thu Nov 29 23:38:44 2001 Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fATNcim37301 for ; Thu, 29 Nov 2001 18:38:44 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id fATNTTl07662 for pgsql-sql@postgresql.org; Thu, 29 Nov 2001 18:29:29 -0500 (EST) (envelope-from news) From: "Ligia Pimentel" X-Newsgroups: comp.databases.postgresql.sql Subject: An easy question about creating a primary key Date: Thu, 29 Nov 2001 17:22:22 -0600 Organization: . Lines: 13 Message-ID: <9u6gco$7fb$1@news.tht.net> Reply-To: "Ligia Pimentel" X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4522.1200 To: pgsql-sql@postgresql.org X-Archive-Number: 200112/26 X-Sequence-Number: 5849 Hello. I'm using postgres 7.1. I have an easy question... I want to create a primary key constraint on an existing table. The documentation says I can't . Please confirm. If this is true... How can I rename the existing table so I can create the new one and copy the data? Thank you Ligia From sszabo@megazone23.bigpanda.com Mon Dec 3 19:16:18 2001 Received: from megazone.bigpanda.com ([63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB3JGEm15942 for ; Mon, 3 Dec 2001 14:16:18 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id DE18CD5E6; Mon, 3 Dec 2001 11:16:14 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id D3CA55BEA; Mon, 3 Dec 2001 11:16:14 -0800 (PST) Date: Mon, 3 Dec 2001 11:16:14 -0800 (PST) From: Stephan Szabo To: Ligia Pimentel Cc: Subject: Re: An easy question about creating a primary key In-Reply-To: <9u6gco$7fb$1@news.tht.net> Message-ID: <20011203111257.H93680-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200112/27 X-Sequence-Number: 5850 On Thu, 29 Nov 2001, Ligia Pimentel wrote: > Hello. > > I'm using postgres 7.1. I have an easy question... > > I want to create a primary key constraint on an existing table. The > documentation says I can't . Please confirm. If this is true... How can I > rename the existing table so I can create the new one and copy the data? I believe that's correct for 7.1 at least. You can rename tables using ALTER TABLE (alter table rename to ). If the column(s) are marked not null already, you may be able to just get away with creating a unique index on the column(s) named "
_pkey" From josh@agliodbs.com Mon Dec 3 19:20:19 2001 Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB3JKJm16258 for ; Mon, 3 Dec 2001 14:20:19 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.7) with HTTP id 519076; Mon, 03 Dec 2001 11:20:07 -0800 From: "Josh Berkus" Subject: Re: An easy question about creating a primary key To: "Ligia Pimentel" , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.7 Date: Mon, 03 Dec 2001 11:20:07 -0800 Message-ID: In-Reply-To: <9u6gco$7fb$1@news.tht.net> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200112/30 X-Sequence-Number: 5853 Ligia, > I want to create a primary key constraint on an existing table. The > documentation says I can't . Please confirm. If this is true... How > can I > rename the existing table so I can create the new one and copy the > data? FYI, this question is more appropriate for the NOVICE list. You would use the same method that you use to drop and recreate the table for other reasons: CREATE TABLE tablea_temp AS SELECT * FROM tablea; DROP tablea; CREATE tablea ( primary_key SERIAL ... ); INSERT INTO tablea (column list) SELECT (column list) FROM tablea_temp; And don't forget to re-build your indexes! -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco From chriskl@familyhealth.com.au Tue Dec 4 01:35:34 2001 Received: from mail.iinet.net.au (symphony-01.iinet.net.au [203.59.3.33]) by postgresql.org (8.11.3/8.11.4) with SMTP id fB41ZXm36214 for ; Mon, 3 Dec 2001 20:35:34 -0500 (EST) (envelope-from chriskl@familyhealth.com.au) Received: (qmail 2581 invoked by uid 666); 4 Dec 2001 01:35:33 -0000 Received: from unknown (HELO houston.familyhealth.com.au) (203.59.231.6) by mail.iinet.net.au with SMTP; 4 Dec 2001 01:35:33 -0000 Received: (from root@localhost) by houston.familyhealth.com.au (8.11.6/8.11.6) id fB41ZWk26146 for pgsql-sql@postgresql.org; Tue, 4 Dec 2001 09:35:32 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Received: from mariner (mariner.internal [192.168.0.101]) by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id fB41ZSG26049; Tue, 4 Dec 2001 09:35:28 +0800 (WST) From: "Christopher Kings-Lynne" To: "Ligia Pimentel" , Subject: Re: An easy question about creating a primary key Date: Tue, 4 Dec 2001 09:36:18 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <9u6gco$7fb$1@news.tht.net> X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) X-Archive-Number: 200112/32 X-Sequence-Number: 5855 Hi Ligia, I have submitted code for 7.2b3 that allows ADD UNIQUE after table creation, but you'll have to wait until 7.3 for ADD PRIMARY KEY after table createion. What you can do however is something like this: 1. Make sure the column you want to make a primary key is NOT NULL and there are no other PRIMARY KEYs on the table. 2. BEGIN; CREATE UNIQUE INDEX blah ON table(field); UPDATE pg_index SET indisprimary=true WHERE indexrelid=(SELECT oid FROM pg_class WHERE relname='blah')) COMMIT; Not that as far as postgres is concerned a UNIQUE, NOT NULL index is exactly the same as a PRIMARY KEY index. All that the above catalog tweak does is actually mark the index as being primary in pg_dump, etc. Chris > -----Original Message----- > From: pgsql-sql-owner@postgresql.org > [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Ligia Pimentel > Sent: Friday, 30 November 2001 7:22 AM > To: pgsql-sql@postgresql.org > Subject: [SQL] An easy question about creating a primary key > > > Hello. > > I'm using postgres 7.1. I have an easy question... > > I want to create a primary key constraint on an existing table. The > documentation says I can't . Please confirm. If this is true... How can I > rename the existing table so I can create the new one and copy the data? > > Thank you > > Ligia > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > From tgl@sss.pgh.pa.us Tue Dec 4 02:12:49 2001 Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB42Cnm40493 for ; Mon, 3 Dec 2001 21:12:49 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id fB42CLi20777; Mon, 3 Dec 2001 21:12:21 -0500 (EST) To: "Christopher Kings-Lynne" cc: "Ligia Pimentel" , pgsql-sql@postgresql.org Subject: Re: An easy question about creating a primary key In-reply-to: References: Comments: In-reply-to "Christopher Kings-Lynne" message dated "Tue, 04 Dec 2001 09:36:18 +0800" Date: Mon, 03 Dec 2001 21:12:21 -0500 Message-ID: <20774.1007431941@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200112/33 X-Sequence-Number: 5856 "Christopher Kings-Lynne" writes: > I have submitted code for 7.2b3 that allows ADD UNIQUE after table creation, > but you'll have to wait until 7.3 for ADD PRIMARY KEY after table createion. I think you've forgotten your own work, Chris. regression=# create table foo (bar int not null); CREATE regression=# alter table foo add primary key (bar); NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo' CREATE regression=# Having to have marked the columns as "not null" from the beginning is a painful limitation, but it's not like the feature doesn't exist at all. regards, tom lane From chriskl@familyhealth.com.au Tue Dec 4 02:22:32 2001 Received: from mail.iinet.net.au (symphony-02.iinet.net.au [203.59.3.34]) by postgresql.org (8.11.3/8.11.4) with SMTP id fB42MWm40818 for ; Mon, 3 Dec 2001 21:22:32 -0500 (EST) (envelope-from chriskl@familyhealth.com.au) Received: (qmail 18138 invoked by uid 666); 4 Dec 2001 02:22:35 -0000 Received: from unknown (HELO houston.familyhealth.com.au) (203.59.231.6) by mail.iinet.net.au with SMTP; 4 Dec 2001 02:22:35 -0000 Received: (from root@localhost) by houston.familyhealth.com.au (8.11.6/8.11.6) id fB42MVL27138 for pgsql-hackers@postgresql.org; Tue, 4 Dec 2001 10:22:31 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Received: from mariner (mariner.internal [192.168.0.101]) by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id fB42MTG26992; Tue, 4 Dec 2001 10:22:29 +0800 (WST) From: "Christopher Kings-Lynne" To: "Tom Lane" Cc: "Ligia Pimentel" , "Hackers" Subject: Re: [SQL] An easy question about creating a primary key Date: Tue, 4 Dec 2001 10:23:19 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <20774.1007431941@sss.pgh.pa.us> X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) X-Archive-Number: 200112/70 X-Sequence-Number: 16218 > I think you've forgotten your own work, Chris. > > regression=# create table foo (bar int not null); > CREATE > regression=# alter table foo add primary key (bar); > NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index > 'foo_pkey' for table 'foo' > CREATE > regression=# Bizarre. That patch was never committed. If you check src/backend/commands/command.c and search for 'CONSTR_' you'll notice that the CONSTR_UNIQUE function I implemented is there, but CONSTR_PRIMARY is definitely not being handled. (I'm looking at the 7.2b2 source code) Chris From tgl@sss.pgh.pa.us Tue Dec 4 02:29:54 2001 Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB42Trm41028 for ; Mon, 3 Dec 2001 21:29:54 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id fB42Toi21382; Mon, 3 Dec 2001 21:29:50 -0500 (EST) To: "Christopher Kings-Lynne" cc: "Ligia Pimentel" , "Hackers" Subject: Re: [SQL] An easy question about creating a primary key In-reply-to: References: Comments: In-reply-to "Christopher Kings-Lynne" message dated "Tue, 04 Dec 2001 10:23:19 +0800" Date: Mon, 03 Dec 2001 21:29:49 -0500 Message-ID: <21379.1007432989@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200112/71 X-Sequence-Number: 16219 "Christopher Kings-Lynne" writes: >> I think you've forgotten your own work, Chris. >> >> regression=# create table foo (bar int not null); >> CREATE >> regression=# alter table foo add primary key (bar); >> NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index >> 'foo_pkey' for table 'foo' >> CREATE >> regression=# > Bizarre. That patch was never committed. If you check > src/backend/commands/command.c and search for 'CONSTR_' you'll notice that > the CONSTR_UNIQUE function I implemented is there, but CONSTR_PRIMARY is > definitely not being handled. (I'm looking at the 7.2b2 source code) Hmm ... actually, I wonder whether that code in command.c isn't entirely dead code. I believe that as things stand, parser/analyze.c converts UNIQUE and PRIMARY constraints into CREATE INDEX statements; the constraint nodes themselves never make it past the parser. It looks to me like command.c only needs to handle CHECK constraints and foreign-key constraints, cf transformAlterTableStmt(). regards, tom lane From tgl@sss.pgh.pa.us Tue Dec 4 02:40:24 2001 Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB42eOm41439 for ; Mon, 3 Dec 2001 21:40:24 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id fB42eKi21445; Mon, 3 Dec 2001 21:40:21 -0500 (EST) To: "Christopher Kings-Lynne" cc: "Ligia Pimentel" , "Hackers" Subject: Re: [SQL] An easy question about creating a primary key In-reply-to: <21379.1007432989@sss.pgh.pa.us> References: <21379.1007432989@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 03 Dec 2001 21:29:49 -0500" Date: Mon, 03 Dec 2001 21:40:20 -0500 Message-ID: <21442.1007433620@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200112/72 X-Sequence-Number: 16220 Now that I look at it, I think I made the relevant changes in the parser: 2001-10-11 20:07 tgl * doc/src/sgml/ref/alter_table.sgml, src/backend/catalog/pg_type.c, src/backend/commands/command.c, src/backend/parser/analyze.c, src/backend/tcop/utility.c, src/include/commands/command.h, src/include/nodes/parsenodes.h, src/test/regress/expected/alter_table.out, src/test/regress/expected/foreign_key.out: Break transformCreateStmt() into multiple routines and make transformAlterStmt() use these routines, instead of having lots of duplicate (not to mention should-have-been-duplicate) code. Adding a column with a CHECK constraint actually works now, and the tests to reject unsupported DEFAULT and NOT NULL clauses actually fire now. ALTER TABLE ADD PRIMARY KEY works, modulo having to have created the column(s) NOT NULL already. I was mainly interested in eliminating the inconsistencies in parse-time handling of CREATE TABLE and ALTER TABLE, and the ensuing bugs mentioned in the commit log. I didn't think much about the possibility that I was obsoleting stuff in command.c, but maybe I did. regards, tom lane From chriskl@familyhealth.com.au Tue Dec 4 02:51:23 2001 Received: from mail.iinet.net.au (symphony-03.iinet.net.au [203.59.3.35]) by postgresql.org (8.11.3/8.11.4) with SMTP id fB42pMm41740 for ; Mon, 3 Dec 2001 21:51:23 -0500 (EST) (envelope-from chriskl@familyhealth.com.au) Received: (qmail 31376 invoked by uid 666); 4 Dec 2001 02:49:21 -0000 Received: from unknown (HELO houston.familyhealth.com.au) (203.59.231.6) by mail.iinet.net.au with SMTP; 4 Dec 2001 02:49:21 -0000 Received: (from root@localhost) by houston.familyhealth.com.au (8.11.6/8.11.6) id fB42nI227925 for pgsql-hackers@postgresql.org; Tue, 4 Dec 2001 10:49:18 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Received: from mariner (mariner.internal [192.168.0.101]) by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id fB42nFG27779; Tue, 4 Dec 2001 10:49:15 +0800 (WST) From: "Christopher Kings-Lynne" To: "Tom Lane" Cc: "Ligia Pimentel" , "Hackers" Subject: Re: [SQL] An easy question about creating a primary key Date: Tue, 4 Dec 2001 10:50:06 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <21442.1007433620@sss.pgh.pa.us> X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) X-Archive-Number: 200112/74 X-Sequence-Number: 16222 You know, that would explain a lot. Since this was only done in October, I wouldn't have noticed it. And it explains why I couldn't get various changes in my code to actually have any effect... Oh well, it was a fun coding exercise ;) Feel free to remove the ADD UNIQUE stuff from command.c to see if the parser will handle it. However, your commit message also just implies that all you fixed was ADD PRIMARY KEY??? Chris > -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > Sent: Tuesday, 4 December 2001 10:40 AM > To: Christopher Kings-Lynne > Cc: Ligia Pimentel; Hackers > Subject: Re: [SQL] An easy question about creating a primary key > > > Now that I look at it, I think I made the relevant changes in the > parser: > > 2001-10-11 20:07 tgl > > * doc/src/sgml/ref/alter_table.sgml, src/backend/catalog/pg_type.c, > src/backend/commands/command.c, src/backend/parser/analyze.c, > src/backend/tcop/utility.c, src/include/commands/command.h, > src/include/nodes/parsenodes.h, > src/test/regress/expected/alter_table.out, > src/test/regress/expected/foreign_key.out: Break > transformCreateStmt() into multiple routines and make > transformAlterStmt() use these routines, instead of having lots of > duplicate (not to mention should-have-been-duplicate) code. Adding > a column with a CHECK constraint actually works now, and the tests > to reject unsupported DEFAULT and NOT NULL clauses actually fire > now. ALTER TABLE ADD PRIMARY KEY works, modulo having to have > created the column(s) NOT NULL already. > > I was mainly interested in eliminating the inconsistencies in parse-time > handling of CREATE TABLE and ALTER TABLE, and the ensuing bugs mentioned > in the commit log. I didn't think much about the possibility that I was > obsoleting stuff in command.c, but maybe I did. > > regards, tom lane > From tgl@sss.pgh.pa.us Tue Dec 4 02:54:10 2001 Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB42sAm41784 for ; Mon, 3 Dec 2001 21:54:10 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id fB42s6i21563; Mon, 3 Dec 2001 21:54:06 -0500 (EST) To: "Christopher Kings-Lynne" cc: "Ligia Pimentel" , "Hackers" Subject: Re: [SQL] An easy question about creating a primary key In-reply-to: References: Comments: In-reply-to "Christopher Kings-Lynne" message dated "Tue, 04 Dec 2001 10:50:06 +0800" Date: Mon, 03 Dec 2001 21:54:06 -0500 Message-ID: <21560.1007434446@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200112/73 X-Sequence-Number: 16221 "Christopher Kings-Lynne" writes: > Oh well, it was a fun coding exercise ;) Feel free to remove the ADD UNIQUE > stuff from command.c to see if the parser will handle it. However, your > commit message also just implies that all you fixed was ADD PRIMARY KEY??? It says that because I thought that was all I was changing; I hadn't realized the side-effects on ADD UNIQUE. regards, tom lane From pgman@candle.pha.pa.us Fri Dec 28 05:11:10 2001 Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBS5BAm46895 for ; Fri, 28 Dec 2001 00:11:10 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id fBS5B0r01906; Fri, 28 Dec 2001 00:11:00 -0500 (EST) From: Bruce Momjian Message-Id: <200112280511.fBS5B0r01906@candle.pha.pa.us> Subject: Re: [SQL] An easy question about creating a primary key In-Reply-To: <21560.1007434446@sss.pgh.pa.us> "from Tom Lane at Dec 3, 2001 09:54:06 pm" To: Tom Lane Date: Fri, 28 Dec 2001 00:11:00 -0500 (EST) CC: Christopher Kings-Lynne , Ligia Pimentel , Hackers X-Mailer: ELM [version 2.4ME+ PL90 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200112/881 X-Sequence-Number: 17003 Is this resolved? --------------------------------------------------------------------------- > "Christopher Kings-Lynne" writes: > > Oh well, it was a fun coding exercise ;) Feel free to remove the ADD UNIQUE > > stuff from command.c to see if the parser will handle it. However, your > > commit message also just implies that all you fixed was ADD PRIMARY KEY??? > > It says that because I thought that was all I was changing; I hadn't > realized the side-effects on ADD UNIQUE. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 From tgl@sss.pgh.pa.us Fri Dec 28 05:21:04 2001 Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBS5L4m47371 for ; Fri, 28 Dec 2001 00:21:04 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id fBS5Kij29175; Fri, 28 Dec 2001 00:20:44 -0500 (EST) To: Bruce Momjian cc: Christopher Kings-Lynne , Ligia Pimentel , Hackers Subject: Re: [SQL] An easy question about creating a primary key In-reply-to: <200112280511.fBS5B0r01906@candle.pha.pa.us> References: <200112280511.fBS5B0r01906@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Fri, 28 Dec 2001 00:11:00 -0500" Date: Fri, 28 Dec 2001 00:20:44 -0500 Message-ID: <29172.1009516844@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200112/883 X-Sequence-Number: 17005 Bruce Momjian writes: > Is this resolved? Yup, the no-longer-needed code is gone. regards, tom lane From chriskl@familyhealth.com.au Wed Jan 2 03:36:45 2002 Received: from mail.iinet.net.au (symphony-06.iinet.net.au [203.59.3.38]) by postgresql.org (8.11.3/8.11.4) with SMTP id g023aim13615 for ; Tue, 1 Jan 2002 22:36:45 -0500 (EST) (envelope-from chriskl@familyhealth.com.au) Received: (qmail 16598 invoked by uid 666); 2 Jan 2002 03:36:41 -0000 Received: from unknown (HELO houston.familyhealth.com.au) (203.59.231.6) by mail.iinet.net.au with SMTP; 2 Jan 2002 03:36:41 -0000 Received: (from root@localhost) by houston.familyhealth.com.au (8.11.6/8.11.6) id g023aiM54052 for pgsql-hackers@postgresql.org; Wed, 2 Jan 2002 11:36:44 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Received: from mariner (mariner.internal [192.168.0.101]) by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id g023ahk54000 for ; Wed, 2 Jan 2002 11:36:43 +0800 (WST) From: "Christopher Kings-Lynne" To: "Hackers" Subject: Re: [SQL] An easy question about creating a primary key Date: Wed, 2 Jan 2002 11:36:53 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <200112280511.fBS5B0r01906@candle.pha.pa.us> X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) X-Archive-Number: 200201/7 X-Sequence-Number: 17079 Note that although I added a regression test for ADD UNIQUE (and had some confusion as it was Tom's error messages generated, not mine!), I didn't add an ADD PRIMARY KEY one. It should be done in 7.3 I guess. Chris > -----Original Message----- > From: Bruce Momjian [mailto:pgman@candle.pha.pa.us] > Sent: Friday, 28 December 2001 1:11 PM > To: Tom Lane > Cc: Christopher Kings-Lynne; Ligia Pimentel; Hackers > Subject: Re: [HACKERS] [SQL] An easy question about creating a primary > key > > > > Is this resolved? > > ------------------------------------------------------------------ > --------- > > > "Christopher Kings-Lynne" writes: > > > Oh well, it was a fun coding exercise ;) Feel free to remove > the ADD UNIQUE > > > stuff from command.c to see if the parser will handle it. > However, your > > > commit message also just implies that all you fixed was ADD > PRIMARY KEY??? > > > > It says that because I thought that was all I was changing; I hadn't > > realized the side-effects on ADD UNIQUE. > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 853-3000 > + If your life is a hard drive, | 830 Blythe Avenue > + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 >