Re: [HACKERS] ALTER TABLE / CLUSTER ON
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) Index: backend/commands/tablecmds.c === RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/tablecmds.c,v retrieving revision 1.69 diff -c -r1.69 tablecmds.c *** backend/commands/tablecmds.c2003/03/20 18:52:47 1.69 --- backend/commands/tablecmds.c2003/03/21 15:38:37 *** *** 3835,3840 --- 3835,3841 { elog(NOTICE, ALTER TABLE: table \%s\ is already being clustered on index \%s\, NameStr(rel-rd_rel-relname), indexName); + ReleaseSysCache(indexTuple); heap_close(rel, AccessExclusiveLock); return; } ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
Re: [HACKERS] ALTER TABLE / CLUSTER ON
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 [EMAIL PROTECTED]
Re: [HACKERS] ALTER TABLE / CLUSTER ON
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) ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] ALTER TABLE / CLUSTER ON
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 ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster