@@ 4333-4365 (lines=33) @@ | ||
4330 | * |
|
4331 | * @return int 0 success |
|
4332 | */ |
|
4333 | protected function _alterView($vwrs, $name, $owner, $schema, $comment) |
|
4334 | { |
|
4335 | $this->fieldArrayClean($vwrs->fields); |
|
4336 | ||
4337 | // Comment |
|
4338 | if ($this->setComment('VIEW', $vwrs->fields['relname'], '', $comment) != 0) { |
|
4339 | return -4; |
|
4340 | } |
|
4341 | ||
4342 | // Owner |
|
4343 | $this->fieldClean($owner); |
|
4344 | $status = $this->alterViewOwner($vwrs, $owner); |
|
4345 | if ($status != 0) { |
|
4346 | return -5; |
|
4347 | } |
|
4348 | ||
4349 | // Rename |
|
4350 | $this->fieldClean($name); |
|
4351 | $status = $this->alterViewName($vwrs, $name); |
|
4352 | if ($status != 0) { |
|
4353 | return -3; |
|
4354 | } |
|
4355 | ||
4356 | // Schema |
|
4357 | $this->fieldClean($schema); |
|
4358 | $status = $this->alterViewSchema($vwrs, $schema); |
|
4359 | if ($status != 0) { |
|
4360 | return -6; |
|
4361 | } |
|
4362 | ||
4363 | return 0; |
|
4364 | } |
|
4365 | ||
4366 | /** |
|
4367 | * Alter a view's owner. |
|
4368 | * |
@@ 266-299 (lines=34) @@ | ||
263 | * |
|
264 | * @return int 0 success |
|
265 | */ |
|
266 | protected function _alterTable($tblrs, $name, $owner, $schema, $comment, $tablespace) |
|
267 | { |
|
268 | ||
269 | /* $schema not supported in pg80- */ |
|
270 | ||
271 | // Comment |
|
272 | $status = $this->setComment('TABLE', '', $tblrs->fields['relname'], $comment); |
|
273 | if ($status != 0) { |
|
274 | return -4; |
|
275 | } |
|
276 | ||
277 | // Owner |
|
278 | $this->fieldClean($owner); |
|
279 | $status = $this->alterTableOwner($tblrs, $owner); |
|
280 | if ($status != 0) { |
|
281 | return -5; |
|
282 | } |
|
283 | ||
284 | // Tablespace |
|
285 | $this->fieldClean($tablespace); |
|
286 | $status = $this->alterTableTablespace($tblrs, $tablespace); |
|
287 | if ($status != 0) { |
|
288 | return -6; |
|
289 | } |
|
290 | ||
291 | // Rename |
|
292 | $this->fieldClean($name); |
|
293 | $status = $this->alterTableName($tblrs, $name); |
|
294 | if ($status != 0) { |
|
295 | return -3; |
|
296 | } |
|
297 | ||
298 | return 0; |
|
299 | } |
|
300 | ||
301 | /** |
|
302 | * Protected method which alter a view |