Re: psql - -dry-run option

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: psql - -dry-run option
Дата
Msg-id CAMsr+YGiYQ7PYvYR2Voio37YdCpp79j5S+cmgVJMOLM2LnRQcA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: psql - -dry-run option  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
Список pgsql-hackers
On 18 December 2015 at 16:50, Shulgin, Oleksandr <oleksandr.shulgin@zalando.de> wrote:
 
I'm on the same line: BEGIN/ROLLBACK requires trivial effort and a --dry-run option might give a false sense of security, but it cannot possibly rollback side-effects of user functions which modify filesystem or interact with the outside world in some other way.

Pretty much. Side effects.

The most glaringly obvious example is nextval(...) and setval(...). You can't make them have no effect, since your script will then fail to run. But you can't roll them back either.

Also, anything that touches the file system, like COPY. Untrusted PLs that can fiddle with the file system. FDWs. All sorts. Oh, and of course psql commands like \o .

I think this idea is completely unworkable. You might work around the filesystem access issues with a new attribute (like LEAKPROOF) that asserts that a function relies strictly on in-database transactional behaviour. But you're not going to be able to do a dry run with sequence setting. You could ignore setval and run nextval as normal, but then your dry-run wouldn't reflect what the real run would do...

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: psql - -dry-run option
Следующее
От: Haribabu Kommi
Дата:
Сообщение: Re: Parallel Aggregate