|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.108 2004/05/26 04:41:12 neilc Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.109 2004/06/02 21:01:08 momjian Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -233,6 +233,7 @@ static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab);
|
233 | 233 | staticvoidATPostAlterTypeParse(char*cmd,List**wqueue);
|
234 | 234 | staticvoidATExecChangeOwner(OidrelationOid,int32newOwnerSysId);
|
235 | 235 | staticvoidATExecClusterOn(Relationrel,constchar*indexName);
|
| 236 | +staticvoidATExecDropCluster(Relationrel); |
236 | 237 | staticintri_trigger_type(Oidtgfoid);
|
237 | 238 | staticvoidupdate_ri_trigger_args(Oidrelid,
|
238 | 239 | constchar*oldname,
|
@@ -1922,8 +1923,9 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
|
1922 | 1923 | pass=AT_PASS_MISC;
|
1923 | 1924 | break;
|
1924 | 1925 | caseAT_ClusterOn:/* CLUSTER ON */
|
| 1926 | +caseAT_DropCluster:/* SET WITHOUT CLUSTER */ |
1925 | 1927 | ATSimplePermissions(rel, false);
|
1926 |
| -/*This command neverrecurses */ |
| 1928 | +/*These commands neverrecurse */ |
1927 | 1929 | /* No command-specific prep needed */
|
1928 | 1930 | pass=AT_PASS_MISC;
|
1929 | 1931 | break;
|
@@ -2083,6 +2085,9 @@ ATExecCmd(AlteredTableInfo *tab, Relation rel, AlterTableCmd *cmd)
|
2083 | 2085 | caseAT_ClusterOn:/* CLUSTER ON */
|
2084 | 2086 | ATExecClusterOn(rel,cmd->name);
|
2085 | 2087 | break;
|
| 2088 | +caseAT_DropCluster:/* SET WITHOUT CLUSTER */ |
| 2089 | +ATExecDropCluster(rel); |
| 2090 | +break; |
2086 | 2091 | caseAT_DropOids:/* SET WITHOUT OIDS */
|
2087 | 2092 | /*
|
2088 | 2093 | * Nothing to do here; we'll have generated a DropColumn subcommand
|
@@ -5044,6 +5049,19 @@ ATExecClusterOn(Relation rel, const char *indexName)
|
5044 | 5049 | mark_index_clustered(rel,indexOid);
|
5045 | 5050 | }
|
5046 | 5051 |
|
| 5052 | +/* |
| 5053 | + * ALTER TABLE SET WITHOUT CLUSTER |
| 5054 | + * |
| 5055 | + * We have to find any indexes on the table that have indisclustered bit |
| 5056 | + * set and turn it off. |
| 5057 | + */ |
| 5058 | +staticvoid |
| 5059 | +ATExecDropCluster(Relationrel) |
| 5060 | +{ |
| 5061 | +mark_index_clustered(rel,InvalidOid); |
| 5062 | +} |
| 5063 | + |
| 5064 | + |
5047 | 5065 | /*
|
5048 | 5066 | * ALTER TABLE CREATE TOAST TABLE
|
5049 | 5067 | *
|
|