Re: drop if exists
| От | Tom Lane |
|---|---|
| Тема | Re: drop if exists |
| Дата | |
| Msg-id | 29806.1129391860@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: drop if exists (Andrew Dunstan <andrew@dunslane.net>) |
| Список | pgsql-hackers |
Andrew Dunstan <andrew@dunslane.net> writes:
> Rod Taylor wrote:
>> I would rather have a 'rollback or release savepoint' command which
>> would rollback to the savepoint if there was an error or release it
>> otherwise.
>>
>> This way any command or combination of commands could be aborted or
>> continued as a group in a statically defined script.
> I don't see that they are mutually exclusive, although one could achieve
> the effect this way.
For single-command transactions, you don't actually need either one.
Ignoring the error message from the failed DROP works fine.
If you're trying to wrap the creation of a whole schema in an outer
transaction, though, you need one or the other --- and Rod's suggestion
is definitely more flexible.
I think the main argument in favor of DROP IF EXISTS is that people
coming from MySQL are accustomed to having it.
regards, tom lane
В списке pgsql-hackers по дате отправления: