Re: Shell Command within function

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: Shell Command within function
Дата
Msg-id 87va5o7v3k.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Shell Command within function  (Mike Martin <redtux1@gmail.com>)
Список pgsql-general
>>>>> "Mike" == Mike Martin <redtux1@gmail.com> writes:

 Mike> Is this possible?

In an untrusted pl language, yes, but it's a bad idea because:

 Mike> I have a script which imports csvlogs into a table, and it would
 Mike> be useful to truncate the log files after import

If you had an error after truncating the file but before committing the
transaction, then the imported data would be gone, but the file would be
gone too, so you'd have lost it.

Things like this need to be handled _after_ commit, not before, so a
function is the wrong place for it.

-- 
Andrew (irc:RhodiumToad)


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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Shell Command within function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Should pg 11 use a lot more memory building an spgist index?