Re: pgsql-server: Add ALTER INDEX, particularly for

Lists: pgsql-committers
From: momjian(at)svr1(dot)postgresql(dot)org (Bruce Momjian)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql-server: Add ALTER INDEX, particularly for moving tablespaces.
Date: 2004-08-20 04:29:33
Message-ID: 20040820042933.975C15E40AC@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Log Message:
-----------
Add ALTER INDEX, particularly for moving tablespaces.

Gavin Sherry

Modified Files:
--------------
pgsql-server/src/backend/parser:
gram.y (r2.471 -> r2.472)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/parser/gram.y.diff?r1=2.471&r2=2.472)
pgsql-server/src/backend/tcop:
utility.c (r1.225 -> r1.226)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/tcop/utility.c.diff?r1=1.225&r2=1.226)
pgsql-server/src/bin/psql:
tab-complete.c (r1.109 -> r1.110)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/psql/tab-complete.c.diff?r1=1.109&r2=1.110)
pgsql-server/src/include/nodes:
parsenodes.h (r1.266 -> r1.267)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/include/nodes/parsenodes.h.diff?r1=1.266&r2=1.267)

Added Files:
-----------
pgsql-server/doc/src/sgml/ref:
alter_index.sgml (r1.1)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/doc/src/sgml/ref/alter_index.sgml?rev=1.1&content-type=text/x-cvsweb-markup)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for moving tablespaces.
Date: 2004-08-21 17:21:15
Message-ID: 22431.1093108875@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

momjian(at)svr1(dot)postgresql(dot)org (Bruce Momjian) writes:
> Add ALTER INDEX, particularly for moving tablespaces.

This patch is a perfect example of why unreviewed patches should not
go in during beta.

So far I have noticed the following problems with it:

* Added reference page wasn't linked into the docs build.

* Added a field to struct AlterTableStmt, but did not do the necessary
housekeeping for extending a Node (eg, copyfuncs and equalfuncs
adjustments), nor make sure the field is validly set in every place
an AlterTableStmt is constructed.

* ALTER INDEX RENAME doesn't actually work.

regression=# alter index foo_pkey rename to zzz;
ERROR: unrecognized rename stmt type: 9

That's not counting the problem someone else already reported with
incorrect tab-completion.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for moving
Date: 2004-08-21 18:46:54
Message-ID: 200408211846.i7LIks022953@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Tom Lane wrote:
> momjian(at)svr1(dot)postgresql(dot)org (Bruce Momjian) writes:
> > Add ALTER INDEX, particularly for moving tablespaces.
>
> This patch is a perfect example of why unreviewed patches should not
> go in during beta.
>
> So far I have noticed the following problems with it:
>
> * Added reference page wasn't linked into the docs build.
>
> * Added a field to struct AlterTableStmt, but did not do the necessary
> housekeeping for extending a Node (eg, copyfuncs and equalfuncs
> adjustments), nor make sure the field is validly set in every place
> an AlterTableStmt is constructed.
>
> * ALTER INDEX RENAME doesn't actually work.
>
> regression=# alter index foo_pkey rename to zzz;
> ERROR: unrecognized rename stmt type: 9
>
> That's not counting the problem someone else already reported with
> incorrect tab-completion.

Yes, you are right. Because Gavin is "Mr Tablespaces" I didn't give it
a thorough read.

FYI, I just fixed the tab completion problem.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for
Date: 2004-08-21 22:44:49
Message-ID: 20040821194409.V10415@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

On Sat, 21 Aug 2004, Bruce Momjian wrote:

> Tom Lane wrote:
>> momjian(at)svr1(dot)postgresql(dot)org (Bruce Momjian) writes:
>>> Add ALTER INDEX, particularly for moving tablespaces.
>>
>> This patch is a perfect example of why unreviewed patches should not
>> go in during beta.
>>
>> So far I have noticed the following problems with it:
>>
>> * Added reference page wasn't linked into the docs build.
>>
>> * Added a field to struct AlterTableStmt, but did not do the necessary
>> housekeeping for extending a Node (eg, copyfuncs and equalfuncs
>> adjustments), nor make sure the field is validly set in every place
>> an AlterTableStmt is constructed.
>>
>> * ALTER INDEX RENAME doesn't actually work.
>>
>> regression=# alter index foo_pkey rename to zzz;
>> ERROR: unrecognized rename stmt type: 9
>>
>> That's not counting the problem someone else already reported with
>> incorrect tab-completion.
>
> Yes, you are right. Because Gavin is "Mr Tablespaces" I didn't give it
> a thorough read.
>
> FYI, I just fixed the tab completion problem.

Considering point 3 seems a wee bit critical, at least to me, should the
patch be removed and postponed for a non-Beta period?

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org Yahoo!: yscrappy ICQ: 7615664


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for moving
Date: 2004-08-21 23:43:23
Message-ID: 24336.1093131803@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

"Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
> Considering point 3 seems a wee bit critical, at least to me, should the
> patch be removed and postponed for a non-Beta period?

No, the fixes are all trivial. I'm just chewing out Bruce and Gavin
for sloppiness ;-)

regards, tom lane


From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for
Date: 2004-08-22 00:15:00
Message-ID: Pine.LNX.4.58.0408221011200.4212@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Umm... oops.

On Sat, 21 Aug 2004, Tom Lane wrote:

> momjian(at)svr1(dot)postgresql(dot)org (Bruce Momjian) writes:
> > Add ALTER INDEX, particularly for moving tablespaces.
>
> This patch is a perfect example of why unreviewed patches should not
> go in during beta.
>
> So far I have noticed the following problems with it:
>
> * Added reference page wasn't linked into the docs build.
>
> * Added a field to struct AlterTableStmt, but did not do the necessary
> housekeeping for extending a Node (eg, copyfuncs and equalfuncs
> adjustments), nor make sure the field is validly set in every place
> an AlterTableStmt is constructed.
>
> * ALTER INDEX RENAME doesn't actually work.
>
> regression=# alter index foo_pkey rename to zzz;
> ERROR: unrecognized rename stmt type: 9

Thanks for spotting this sloppy work. Basically, I cropped my diff because
there was lots of unrelated code in the work space. But I was a little too
hard and culled allfiles.sgml, alter.c, equal/copyfuncs.c and analyze.c.
BUT I should have tested the patch on a fresh checkout, especially since
someone else noticed the tab-completition naming thing. Sorry.

I was getting together a patch against HEAD but I just noticed that you
fixed this. Thanks.

Gavin


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for moving tablespaces.
Date: 2004-08-22 00:17:55
Message-ID: 25550.1093133875@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> Thanks for spotting this sloppy work. Basically, I cropped my diff because
> there was lots of unrelated code in the work space. But I was a little too
> hard and culled allfiles.sgml, alter.c, equal/copyfuncs.c and analyze.c.

I was wondering if something like that might have happened --- I know
you know better on all these points ;-)

> I was getting together a patch against HEAD but I just noticed that you
> fixed this. Thanks.

Yeah, I think everything is fixed in CVS tip. Let me know if there was
anything I missed.

regards, tom lane


From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for
Date: 2004-08-22 02:47:47
Message-ID: Pine.LNX.4.58.0408221246180.5832@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Here is a change to the alter_table regression test to use ALTER INDEX ...
RENAME instead of ALTER TABLE ... RENAME in the case of an index renaming.
Its probably not the right place for it, but I'm not sure where is the
right place for it.

Thanks,

Gavin

On Sat, 21 Aug 2004, Tom Lane wrote:

> Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > Thanks for spotting this sloppy work. Basically, I cropped my diff because
> > there was lots of unrelated code in the work space. But I was a little too
> > hard and culled allfiles.sgml, alter.c, equal/copyfuncs.c and analyze.c.
>
> I was wondering if something like that might have happened --- I know
> you know better on all these points ;-)
>
> > I was getting together a patch against HEAD but I just noticed that you
> > fixed this. Thanks.
>
> Yeah, I think everything is fixed in CVS tip. Let me know if there was
> anything I missed.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>
> !DSPAM:4127e64e43221930617052!
>
>

Attachment Content-Type Size
regress.diff text/plain 2.2 KB

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for
Date: 2004-08-22 03:39:22
Message-ID: 4128156A.6040306@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

>>Thanks for spotting this sloppy work. Basically, I cropped my diff because
>>there was lots of unrelated code in the work space. But I was a little too
>>hard and culled allfiles.sgml, alter.c, equal/copyfuncs.c and analyze.c.
>
>
> I was wondering if something like that might have happened --- I know
> you know better on all these points ;-)

I have a whole separate CVS checkout for every path I'm working on -
makes life a lot easier :)

Not that Tom doesn't still find bugs in my stuff :P

Chris


From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for
Date: 2004-08-22 04:16:55
Message-ID: 41281E37.3060908@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

> I have a whole separate CVS checkout for every path I'm working on -
> makes life a lot easier :)

Dammit - I meant 'patch'.

Chris


From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for
Date: 2004-08-25 02:20:26
Message-ID: 200408242220.26227.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

I think I missed this in the earlier patches, but does the alter table syntax
still work for indexes in addition to the new syntax?

On Saturday 21 August 2004 22:47, Gavin Sherry wrote:
> Here is a change to the alter_table regression test to use ALTER INDEX ...
> RENAME instead of ALTER TABLE ... RENAME in the case of an index renaming.
> Its probably not the right place for it, but I'm not sure where is the
> right place for it.
>
> Thanks,
>
> Gavin
>
> On Sat, 21 Aug 2004, Tom Lane wrote:
> > Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > > Thanks for spotting this sloppy work. Basically, I cropped my diff
> > > because there was lots of unrelated code in the work space. But I was a
> > > little too hard and culled allfiles.sgml, alter.c, equal/copyfuncs.c
> > > and analyze.c.
> >
> > I was wondering if something like that might have happened --- I know
> > you know better on all these points ;-)
> >
> > > I was getting together a patch against HEAD but I just noticed that you
> > > fixed this. Thanks.
> >
> > Yeah, I think everything is fixed in CVS tip. Let me know if there was
> > anything I missed.
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> >
> >
> > !DSPAM:4127e64e43221930617052!

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for
Date: 2004-08-25 02:31:22
Message-ID: Pine.LNX.4.58.0408251231180.5026@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Yes

On Tue, 24 Aug 2004, Robert Treat wrote:

> I think I missed this in the earlier patches, but does the alter table syntax
> still work for indexes in addition to the new syntax?
>
> On Saturday 21 August 2004 22:47, Gavin Sherry wrote:
> > Here is a change to the alter_table regression test to use ALTER INDEX ...
> > RENAME instead of ALTER TABLE ... RENAME in the case of an index renaming.
> > Its probably not the right place for it, but I'm not sure where is the
> > right place for it.
> >
> > Thanks,
> >
> > Gavin
> >
> > On Sat, 21 Aug 2004, Tom Lane wrote:
> > > Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > > > Thanks for spotting this sloppy work. Basically, I cropped my diff
> > > > because there was lots of unrelated code in the work space. But I was a
> > > > little too hard and culled allfiles.sgml, alter.c, equal/copyfuncs.c
> > > > and analyze.c.
> > >
> > > I was wondering if something like that might have happened --- I know
> > > you know better on all these points ;-)
> > >
> > > > I was getting together a patch against HEAD but I just noticed that you
> > > > fixed this. Thanks.
> > >
> > > Yeah, I think everything is fixed in CVS tip. Let me know if there was
> > > anything I missed.
> > >
> > > regards, tom lane
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> > >
> > >
> > > !DSPAM:4127e64e43221930617052!
>
> --
> Robert Treat
> Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
>


From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for
Date: 2004-08-25 14:18:52
Message-ID: 1093443532.16499.393.camel@camel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Shouldn't the regression tests reflect that?

Robert Treat

On Tue, 2004-08-24 at 22:31, Gavin Sherry wrote:
> Yes
>
> On Tue, 24 Aug 2004, Robert Treat wrote:
>
> > I think I missed this in the earlier patches, but does the alter table syntax
> > still work for indexes in addition to the new syntax?
> >
> > On Saturday 21 August 2004 22:47, Gavin Sherry wrote:
> > > Here is a change to the alter_table regression test to use ALTER INDEX ...
> > > RENAME instead of ALTER TABLE ... RENAME in the case of an index renaming.
> > > Its probably not the right place for it, but I'm not sure where is the
> > > right place for it.
> > >
> > > Thanks,
> > >
> > > Gavin
> > >
> > > On Sat, 21 Aug 2004, Tom Lane wrote:
> > > > Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > > > > Thanks for spotting this sloppy work. Basically, I cropped my diff
> > > > > because there was lots of unrelated code in the work space. But I was a
> > > > > little too hard and culled allfiles.sgml, alter.c, equal/copyfuncs.c
> > > > > and analyze.c.
> > > >
> > > > I was wondering if something like that might have happened --- I know
> > > > you know better on all these points ;-)
> > > >
> > > > > I was getting together a patch against HEAD but I just noticed that you
> > > > > fixed this. Thanks.
> > > >
> > > > Yeah, I think everything is fixed in CVS tip. Let me know if there was
> > > > anything I missed.
> > > >
> > > > regards, tom lane
> > > >
> > > > ---------------------------(end of broadcast)---------------------------
> > > > TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> > > >
> > > >
> > > > !DSPAM:4127e64e43221930617052!
> >
> > --
> > Robert Treat
> > Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
> >
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server: Add ALTER INDEX, particularly for
Date: 2004-08-28 22:06:03
Message-ID: 200408282206.i7SM63n17937@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers


Patch applied. Thanks.

---------------------------------------------------------------------------

Gavin Sherry wrote:
> Here is a change to the alter_table regression test to use ALTER INDEX ...
> RENAME instead of ALTER TABLE ... RENAME in the case of an index renaming.
> Its probably not the right place for it, but I'm not sure where is the
> right place for it.
>
> Thanks,
>
> Gavin
>
> On Sat, 21 Aug 2004, Tom Lane wrote:
>
> > Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > > Thanks for spotting this sloppy work. Basically, I cropped my diff because
> > > there was lots of unrelated code in the work space. But I was a little too
> > > hard and culled allfiles.sgml, alter.c, equal/copyfuncs.c and analyze.c.
> >
> > I was wondering if something like that might have happened --- I know
> > you know better on all these points ;-)
> >
> > > I was getting together a patch against HEAD but I just noticed that you
> > > fixed this. Thanks.
> >
> > Yeah, I think everything is fixed in CVS tip. Let me know if there was
> > anything I missed.
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> >
> >
> > !DSPAM:4127e64e43221930617052!
> >
> >

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073