| @@ 4240-4272 (lines=33) @@ | ||
| 4237 | * @param $comment The comment on the view |
|
| 4238 | * @return int 0 success |
|
| 4239 | */ |
|
| 4240 | protected function _alterView($vwrs, $name, $owner, $schema, $comment) |
|
| 4241 | { |
|
| 4242 | $this->fieldArrayClean($vwrs->fields); |
|
| 4243 | ||
| 4244 | // Comment |
|
| 4245 | if ($this->setComment('VIEW', $vwrs->fields['relname'], '', $comment) != 0) { |
|
| 4246 | return -4; |
|
| 4247 | } |
|
| 4248 | ||
| 4249 | // Owner |
|
| 4250 | $this->fieldClean($owner); |
|
| 4251 | $status = $this->alterViewOwner($vwrs, $owner); |
|
| 4252 | if ($status != 0) { |
|
| 4253 | return -5; |
|
| 4254 | } |
|
| 4255 | ||
| 4256 | // Rename |
|
| 4257 | $this->fieldClean($name); |
|
| 4258 | $status = $this->alterViewName($vwrs, $name); |
|
| 4259 | if ($status != 0) { |
|
| 4260 | return -3; |
|
| 4261 | } |
|
| 4262 | ||
| 4263 | // Schema |
|
| 4264 | $this->fieldClean($schema); |
|
| 4265 | $status = $this->alterViewSchema($vwrs, $schema); |
|
| 4266 | if ($status != 0) { |
|
| 4267 | return -6; |
|
| 4268 | } |
|
| 4269 | ||
| 4270 | return 0; |
|
| 4271 | } |
|
| 4272 | ||
| 4273 | /** |
|
| 4274 | * Alter a view's owner |
|
| 4275 | * |
|
| @@ 262-295 (lines=34) @@ | ||
| 259 | * @param $tablespace The new tablespace for the table ('' means leave as is) |
|
| 260 | * @return int 0 success |
|
| 261 | */ |
|
| 262 | protected function _alterTable($tblrs, $name, $owner, $schema, $comment, $tablespace) |
|
| 263 | { |
|
| 264 | ||
| 265 | /* $schema not supported in pg80- */ |
|
| 266 | ||
| 267 | // Comment |
|
| 268 | $status = $this->setComment('TABLE', '', $tblrs->fields['relname'], $comment); |
|
| 269 | if ($status != 0) { |
|
| 270 | return -4; |
|
| 271 | } |
|
| 272 | ||
| 273 | // Owner |
|
| 274 | $this->fieldClean($owner); |
|
| 275 | $status = $this->alterTableOwner($tblrs, $owner); |
|
| 276 | if ($status != 0) { |
|
| 277 | return -5; |
|
| 278 | } |
|
| 279 | ||
| 280 | // Tablespace |
|
| 281 | $this->fieldClean($tablespace); |
|
| 282 | $status = $this->alterTableTablespace($tblrs, $tablespace); |
|
| 283 | if ($status != 0) { |
|
| 284 | return -6; |
|
| 285 | } |
|
| 286 | ||
| 287 | // Rename |
|
| 288 | $this->fieldClean($name); |
|
| 289 | $status = $this->alterTableName($tblrs, $name); |
|
| 290 | if ($status != 0) { |
|
| 291 | return -3; |
|
| 292 | } |
|
| 293 | ||
| 294 | return 0; |
|
| 295 | } |
|
| 296 | ||
| 297 | /** |
|
| 298 | * Protected method which alter a view |
|