Thread: ALTER TABLE / CLUSTER ON

ALTER TABLE / CLUSTER ON

From
"Christopher Kings-Lynne"
Date:
Does the new ALTER TABLE / CLUSTER ON syntax support the ONLY modifier - it
isn't documented if it is??  I guess it's not really relevant is it?

Chris



Re: ALTER TABLE / CLUSTER ON

From
"Christopher Kings-Lynne"
Date:
I just managed to break the CLUSTER ON patch:

test=# create table test (a int4 primary key, b int4 unique, c int4);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'test_pkey'
for table 'test'
NOTICE:  CREATE TABLE / UNIQUE will create implicit index 'test_b_key' for
table 'test'
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'test_pkey'
for table 'test'
NOTICE:  CREATE TABLE / UNIQUE will create implicit index 'test_b_key' for
table 'test'
CREATE TABLE
test=# create index blah on test(c);
CREATE INDEX
test=# alter table test cluster on a;
ERROR:  ALTER TABLE: cannot find index "a" for table "test"
ERROR:  ALTER TABLE: cannot find index "a" for table "test"
test=# alter table test cluster on blah;
ALTER TABLE
test=# alter table only test cluster on blah;
ERROR:  parser: parse error at or near "cluster" at character 23
ERROR:  parser: parse error at or near "cluster" at character 23
test=# alter table test cluster on blah;
NOTICE:  ALTER TABLE: table "test" is already being clustered on index
"blah"
WARNING:  Cache reference leak: cache pg_index (16), tuple 0 has count 1
NOTICE:  ALTER TABLE: table "test" is already being clustered on index
"blah"
WARNING:  Cache reference leak: cache pg_index (16), tuple 0 has count 1
ALTER TABLE

Chris



Re: ALTER TABLE / CLUSTER ON

From
Alvaro Herrera
Date:
On Fri, Mar 21, 2003 at 11:54:24AM +0800, Christopher Kings-Lynne wrote:
> I just managed to break the CLUSTER ON patch:

Damn... I dunno how I managed to miss this.  Please apply the attached
patch.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Licensee shall have no right to use the Licensed Software
for productive or commercial use. (Licencia de StarOffice 6.0 beta)

Attachment

Re: ALTER TABLE / CLUSTER ON

From
Alvaro Herrera
Date:
On Fri, Mar 21, 2003 at 11:21:16AM +0800, Christopher Kings-Lynne wrote:
> Does the new ALTER TABLE / CLUSTER ON syntax support the ONLY modifier - it
> isn't documented if it is??  I guess it's not really relevant is it?

Oh, sorry, the command does not recurse.  Should it?  The whole CLUSTER
thing does not recurse -- in fact that's why I didn't make the ALTER ...
CLUSTER ON version do it, but maybe it should.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El destino baraja y nosotros jugamos" (A. Schopenhauer)


Re: ALTER TABLE / CLUSTER ON

From
Bruce Momjian
Date:
Patch applied.  Thanks.

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


Alvaro Herrera wrote:
> On Fri, Mar 21, 2003 at 11:54:24AM +0800, Christopher Kings-Lynne wrote:
> > I just managed to break the CLUSTER ON patch:
> 
> Damn... I dunno how I managed to miss this.  Please apply the attached
> patch.
> 
> -- 
> Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
> Licensee shall have no right to use the Licensed Software
> for productive or commercial use. (Licencia de StarOffice 6.0 beta)

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

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


Re: ALTER TABLE / CLUSTER ON

From
Bruce Momjian
Date:
Because indexes don't span to interited tables, I don't see how it could
recurse.


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

Alvaro Herrera wrote:
> On Fri, Mar 21, 2003 at 11:21:16AM +0800, Christopher Kings-Lynne wrote:
> > Does the new ALTER TABLE / CLUSTER ON syntax support the ONLY modifier - it
> > isn't documented if it is??  I guess it's not really relevant is it?
> 
> Oh, sorry, the command does not recurse.  Should it?  The whole CLUSTER
> thing does not recurse -- in fact that's why I didn't make the ALTER ...
> CLUSTER ON version do it, but maybe it should.
> 
> -- 
> Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
> "El destino baraja y nosotros jugamos" (A. Schopenhauer)
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 

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


Re: ALTER TABLE / CLUSTER ON

From
Christopher Kings-Lynne
Date:
How can it recurse, actually - there won't be an index with the same name
in the subtable?

On Fri, 21 Mar 2003, Alvaro Herrera wrote:

> On Fri, Mar 21, 2003 at 11:21:16AM +0800, Christopher Kings-Lynne wrote:
> > Does the new ALTER TABLE / CLUSTER ON syntax support the ONLY modifier - it
> > isn't documented if it is??  I guess it's not really relevant is it?
>
> Oh, sorry, the command does not recurse.  Should it?  The whole CLUSTER
> thing does not recurse -- in fact that's why I didn't make the ALTER ...
> CLUSTER ON version do it, but maybe it should.
>
> --
> Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
> "El destino baraja y nosotros jugamos" (A. Schopenhauer)
>