Re: Transactions within Function

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Transactions within Function
Дата
Msg-id CAHyXU0xMBpeoWFSaAGTAZm4dHQ1avWhRaRi=uFAPAqu2jW3M=A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Transactions within Function  (Andy Chambers <achambers@mcna.net>)
Список pgsql-novice
On Wed, Apr 4, 2012 at 11:17 AM, Andy Chambers <achambers@mcna.net> wrote:
> On Wed, Apr 4, 2012 at 12:07 PM, Steve Horn <steve@stevehorn.cc> wrote:
>> I have a very basic function that performs several steps. Each one of these
>> steps could take a significant amount of time which I would like to track.
>>
>> To do this I am inserting a record to a logging table with a timestamp.
>> After my function runs, all of my log entries have the exact same timestamp.
>> I am assuming this is because they are all being committed in the same
>> transaction.
>>
>> Is there a way I can commit those log inserts in real time?
>
> Use timeofday() rather than current_time.
>
> http://www.postgresql.org/docs/9.1/static/functions-datetime.html

lately, prefer clock_timestamp(), especially if you need to manipulate
the returned time as a timestamp.

merlin

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

Предыдущее
От: Andy Chambers
Дата:
Сообщение: Re: Transactions within Function
Следующее
От: Coby Beck
Дата:
Сообщение: Re: Function returning SETOF returns nothing