|
50 | 50 | * Executes an ALTER OBJECT / RENAME TO statement.Based on the object |
51 | 51 | * type, the function appropriate to that type is executed. |
52 | 52 | */ |
53 | | -void |
| 53 | +Oid |
54 | 54 | ExecRenameStmt(RenameStmt*stmt) |
55 | 55 | { |
56 | 56 | switch (stmt->renameType) |
57 | 57 | { |
58 | 58 | caseOBJECT_AGGREGATE: |
59 | | -RenameAggregate(stmt->object,stmt->objarg,stmt->newname); |
60 | | -break; |
| 59 | +returnRenameAggregate(stmt->object,stmt->objarg,stmt->newname); |
61 | 60 |
|
62 | 61 | caseOBJECT_COLLATION: |
63 | | -RenameCollation(stmt->object,stmt->newname); |
64 | | -break; |
| 62 | +returnRenameCollation(stmt->object,stmt->newname); |
65 | 63 |
|
66 | 64 | caseOBJECT_CONSTRAINT: |
67 | | -RenameConstraint(stmt); |
68 | | -break; |
| 65 | +returnRenameConstraint(stmt); |
69 | 66 |
|
70 | 67 | caseOBJECT_CONVERSION: |
71 | | -RenameConversion(stmt->object,stmt->newname); |
72 | | -break; |
| 68 | +returnRenameConversion(stmt->object,stmt->newname); |
73 | 69 |
|
74 | 70 | caseOBJECT_DATABASE: |
75 | | -RenameDatabase(stmt->subname,stmt->newname); |
76 | | -break; |
| 71 | +returnRenameDatabase(stmt->subname,stmt->newname); |
77 | 72 |
|
78 | 73 | caseOBJECT_FDW: |
79 | | -RenameForeignDataWrapper(stmt->subname,stmt->newname); |
80 | | -break; |
| 74 | +returnRenameForeignDataWrapper(stmt->subname,stmt->newname); |
81 | 75 |
|
82 | 76 | caseOBJECT_FOREIGN_SERVER: |
83 | | -RenameForeignServer(stmt->subname,stmt->newname); |
84 | | -break; |
| 77 | +returnRenameForeignServer(stmt->subname,stmt->newname); |
85 | 78 |
|
86 | 79 | caseOBJECT_EVENT_TRIGGER: |
87 | | -RenameEventTrigger(stmt->subname,stmt->newname); |
88 | | -break; |
| 80 | +returnRenameEventTrigger(stmt->subname,stmt->newname); |
89 | 81 |
|
90 | 82 | caseOBJECT_FUNCTION: |
91 | | -RenameFunction(stmt->object,stmt->objarg,stmt->newname); |
92 | | -break; |
| 83 | +returnRenameFunction(stmt->object,stmt->objarg,stmt->newname); |
93 | 84 |
|
94 | 85 | caseOBJECT_LANGUAGE: |
95 | | -RenameLanguage(stmt->subname,stmt->newname); |
96 | | -break; |
| 86 | +returnRenameLanguage(stmt->subname,stmt->newname); |
97 | 87 |
|
98 | 88 | caseOBJECT_OPCLASS: |
99 | | -RenameOpClass(stmt->object,stmt->subname,stmt->newname); |
100 | | -break; |
| 89 | +returnRenameOpClass(stmt->object,stmt->subname,stmt->newname); |
101 | 90 |
|
102 | 91 | caseOBJECT_OPFAMILY: |
103 | | -RenameOpFamily(stmt->object,stmt->subname,stmt->newname); |
104 | | -break; |
| 92 | +returnRenameOpFamily(stmt->object,stmt->subname,stmt->newname); |
105 | 93 |
|
106 | 94 | caseOBJECT_ROLE: |
107 | | -RenameRole(stmt->subname,stmt->newname); |
108 | | -break; |
| 95 | +returnRenameRole(stmt->subname,stmt->newname); |
109 | 96 |
|
110 | 97 | caseOBJECT_SCHEMA: |
111 | | -RenameSchema(stmt->subname,stmt->newname); |
112 | | -break; |
| 98 | +returnRenameSchema(stmt->subname,stmt->newname); |
113 | 99 |
|
114 | 100 | caseOBJECT_TABLESPACE: |
115 | | -RenameTableSpace(stmt->subname,stmt->newname); |
116 | | -break; |
| 101 | +returnRenameTableSpace(stmt->subname,stmt->newname); |
117 | 102 |
|
118 | 103 | caseOBJECT_TABLE: |
119 | 104 | caseOBJECT_SEQUENCE: |
120 | 105 | caseOBJECT_VIEW: |
121 | 106 | caseOBJECT_INDEX: |
122 | 107 | caseOBJECT_FOREIGN_TABLE: |
123 | | -RenameRelation(stmt); |
124 | | -break; |
| 108 | +returnRenameRelation(stmt); |
125 | 109 |
|
126 | 110 | caseOBJECT_COLUMN: |
127 | 111 | caseOBJECT_ATTRIBUTE: |
128 | | -renameatt(stmt); |
129 | | -break; |
| 112 | +returnrenameatt(stmt); |
130 | 113 |
|
131 | 114 | caseOBJECT_TRIGGER: |
132 | | -renametrig(stmt); |
133 | | -break; |
| 115 | +returnrenametrig(stmt); |
134 | 116 |
|
135 | 117 | caseOBJECT_TSPARSER: |
136 | | -RenameTSParser(stmt->object,stmt->newname); |
137 | | -break; |
| 118 | +returnRenameTSParser(stmt->object,stmt->newname); |
138 | 119 |
|
139 | 120 | caseOBJECT_TSDICTIONARY: |
140 | | -RenameTSDictionary(stmt->object,stmt->newname); |
141 | | -break; |
| 121 | +returnRenameTSDictionary(stmt->object,stmt->newname); |
142 | 122 |
|
143 | 123 | caseOBJECT_TSTEMPLATE: |
144 | | -RenameTSTemplate(stmt->object,stmt->newname); |
145 | | -break; |
| 124 | +returnRenameTSTemplate(stmt->object,stmt->newname); |
146 | 125 |
|
147 | 126 | caseOBJECT_TSCONFIGURATION: |
148 | | -RenameTSConfiguration(stmt->object,stmt->newname); |
149 | | -break; |
| 127 | +returnRenameTSConfiguration(stmt->object,stmt->newname); |
150 | 128 |
|
151 | 129 | caseOBJECT_DOMAIN: |
152 | 130 | caseOBJECT_TYPE: |
153 | | -RenameType(stmt); |
154 | | -break; |
| 131 | +returnRenameType(stmt); |
155 | 132 |
|
156 | 133 | default: |
157 | 134 | elog(ERROR,"unrecognized rename stmt type: %d", |
158 | 135 | (int)stmt->renameType); |
| 136 | +returnInvalidOid;/* keep compiler happy */ |
159 | 137 | } |
160 | 138 | } |
161 | 139 |
|
162 | 140 | /* |
163 | 141 | * Executes an ALTER OBJECT / SET SCHEMA statement. Based on the object |
164 | 142 | * type, the function appropriate to that type is executed. |
165 | 143 | */ |
166 | | -void |
| 144 | +Oid |
167 | 145 | ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt*stmt) |
168 | 146 | { |
169 | 147 | switch (stmt->objectType) |
170 | 148 | { |
171 | 149 | caseOBJECT_AGGREGATE: |
172 | | -AlterFunctionNamespace(stmt->object,stmt->objarg, true, |
173 | | -stmt->newschema); |
174 | | -break; |
| 150 | +returnAlterFunctionNamespace(stmt->object,stmt->objarg, true, |
| 151 | +stmt->newschema); |
175 | 152 |
|
176 | 153 | caseOBJECT_COLLATION: |
177 | | -AlterCollationNamespace(stmt->object,stmt->newschema); |
178 | | -break; |
| 154 | +returnAlterCollationNamespace(stmt->object,stmt->newschema); |
179 | 155 |
|
180 | 156 | caseOBJECT_EXTENSION: |
181 | | -AlterExtensionNamespace(stmt->object,stmt->newschema); |
182 | | -break; |
| 157 | +returnAlterExtensionNamespace(stmt->object,stmt->newschema); |
183 | 158 |
|
184 | 159 | caseOBJECT_FUNCTION: |
185 | | -AlterFunctionNamespace(stmt->object,stmt->objarg, false, |
186 | | -stmt->newschema); |
187 | | -break; |
| 160 | +returnAlterFunctionNamespace(stmt->object,stmt->objarg, false, |
| 161 | +stmt->newschema); |
188 | 162 |
|
189 | 163 | caseOBJECT_SEQUENCE: |
190 | 164 | caseOBJECT_TABLE: |
191 | 165 | caseOBJECT_VIEW: |
192 | 166 | caseOBJECT_FOREIGN_TABLE: |
193 | | -AlterTableNamespace(stmt); |
194 | | -break; |
| 167 | +returnAlterTableNamespace(stmt); |
195 | 168 |
|
196 | 169 | caseOBJECT_TYPE: |
197 | 170 | caseOBJECT_DOMAIN: |
198 | | -AlterTypeNamespace(stmt->object,stmt->newschema,stmt->objectType); |
199 | | -break; |
| 171 | +returnAlterTypeNamespace(stmt->object,stmt->newschema, |
| 172 | +stmt->objectType); |
200 | 173 |
|
201 | 174 | /* generic code path */ |
202 | 175 | caseOBJECT_CONVERSION: |
@@ -228,12 +201,15 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt) |
228 | 201 | AlterObjectNamespace_internal(catalog,address.objectId, |
229 | 202 | nspOid); |
230 | 203 | heap_close(catalog,RowExclusiveLock); |
| 204 | + |
| 205 | +returnaddress.objectId; |
231 | 206 | } |
232 | 207 | break; |
233 | 208 |
|
234 | 209 | default: |
235 | 210 | elog(ERROR,"unrecognized AlterObjectSchemaStmt type: %d", |
236 | 211 | (int)stmt->objectType); |
| 212 | +returnInvalidOid;/* keep compiler happy */ |
237 | 213 | } |
238 | 214 | } |
239 | 215 |
|
@@ -435,38 +411,35 @@ AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid) |
435 | 411 | * Executes an ALTER OBJECT / OWNER TO statement. Based on the object |
436 | 412 | * type, the function appropriate to that type is executed. |
437 | 413 | */ |
438 | | -void |
| 414 | +Oid |
439 | 415 | ExecAlterOwnerStmt(AlterOwnerStmt*stmt) |
440 | 416 | { |
441 | 417 | Oidnewowner=get_role_oid(stmt->newowner, false); |
442 | 418 |
|
443 | 419 | switch (stmt->objectType) |
444 | 420 | { |
445 | 421 | caseOBJECT_DATABASE: |
446 | | -AlterDatabaseOwner(strVal(linitial(stmt->object)),newowner); |
447 | | -break; |
| 422 | +returnAlterDatabaseOwner(strVal(linitial(stmt->object)),newowner); |
448 | 423 |
|
449 | 424 | caseOBJECT_SCHEMA: |
450 | | -AlterSchemaOwner(strVal(linitial(stmt->object)),newowner); |
451 | | -break; |
| 425 | +returnAlterSchemaOwner(strVal(linitial(stmt->object)),newowner); |
452 | 426 |
|
453 | 427 | caseOBJECT_TYPE: |
454 | 428 | caseOBJECT_DOMAIN:/* same as TYPE */ |
455 | | -AlterTypeOwner(stmt->object,newowner,stmt->objectType); |
| 429 | +returnAlterTypeOwner(stmt->object,newowner,stmt->objectType); |
456 | 430 | break; |
457 | 431 |
|
458 | 432 | caseOBJECT_FDW: |
459 | | -AlterForeignDataWrapperOwner(strVal(linitial(stmt->object)), |
460 | | -newowner); |
461 | | -break; |
| 433 | +returnAlterForeignDataWrapperOwner(strVal(linitial(stmt->object)), |
| 434 | +newowner); |
462 | 435 |
|
463 | 436 | caseOBJECT_FOREIGN_SERVER: |
464 | | -AlterForeignServerOwner(strVal(linitial(stmt->object)),newowner); |
465 | | -break; |
| 437 | +returnAlterForeignServerOwner(strVal(linitial(stmt->object)), |
| 438 | +newowner); |
466 | 439 |
|
467 | 440 | caseOBJECT_EVENT_TRIGGER: |
468 | | -AlterEventTriggerOwner(strVal(linitial(stmt->object)),newowner); |
469 | | -break; |
| 441 | +returnAlterEventTriggerOwner(strVal(linitial(stmt->object)), |
| 442 | +newowner); |
470 | 443 |
|
471 | 444 | /* Generic cases */ |
472 | 445 | caseOBJECT_AGGREGATE: |
@@ -508,12 +481,16 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt) |
508 | 481 |
|
509 | 482 | AlterObjectOwner_internal(catalog,address.objectId,newowner); |
510 | 483 | heap_close(catalog,RowExclusiveLock); |
| 484 | + |
| 485 | +returnaddress.objectId; |
511 | 486 | } |
512 | 487 | break; |
513 | 488 |
|
514 | 489 | default: |
515 | 490 | elog(ERROR,"unrecognized AlterOwnerStmt type: %d", |
516 | 491 | (int)stmt->objectType); |
| 492 | + |
| 493 | +returnInvalidOid;/* keep compiler happy */ |
517 | 494 | } |
518 | 495 | } |
519 | 496 |
|
|