Skip site navigation (1) Skip section navigation (2)

Re: Transactions within Function

From: Andy Chambers <achambers(at)mcna(dot)net>
To: pgsql <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Transactions within Function
Date: 2012-04-04 16:17:53
Message-ID: CAAfW55q-W74ibvRbrtOxp3rONq5qK1ieZzTo0-W2iQPG-Vg69g@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Wed, Apr 4, 2012 at 12:07 PM, Steve Horn <steve(at)stevehorn(dot)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

-- 
Andy Chambers
Software Engineer
(e) achambers(at)mcna(dot)net

In response to

Responses

pgsql-novice by date

Next:From: Merlin MoncureDate: 2012-04-04 17:21:03
Subject: Re: Transactions within Function
Previous:From: Steve HornDate: 2012-04-04 16:07:06
Subject: Transactions within Function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group