Re: function for setting/getting same timestamp during whole transaction

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Miroslav Šimulčík <simulcik(dot)miro(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: function for setting/getting same timestamp during whole transaction
Date: 2013-02-08 18:03:48
Message-ID: CA+TgmoZf7YoHS24dVOCx6LHVTP1=2LJY=gd6Cf_=bT-XBLVBtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Wed, Feb 6, 2013 at 7:26 AM, Miroslav Šimulčík
<simulcik(dot)miro(at)gmail(dot)com> wrote:
>> Alternately, you might be able to use a custom GUC from a rather smaller
>> PL/PgSQL function. At transaction start, issue:
>>
>> set_config('myapp.trigger_time', '', 't');
>
>
> This is problem with using custom GUC - clearing variable at transaction
> start. Without clearing it's not sufficient solution (see my response to
> Pavel's mail).

I might be confused here, but I think the point is that if you pass
"true" as the third argument to set_config, the setting lasts only for
the duration of the current transaction, like SET LOCAL. Which I
think solves your problem.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2013-02-08 18:07:30 Re: REINDEX deadlock - Postgresql -9.1
Previous Message Andreas Kretschmer 2013-02-08 18:03:35 Re: Bug, Feature, or what else?

Browse pgsql-hackers by date

  From Date Subject
Next Message Phil Sorber 2013-02-08 18:07:05 Re: [PATCH] pg_isready (was: [WIP] pg_ping utility)
Previous Message Andreas Kretschmer 2013-02-08 18:03:35 Re: Bug, Feature, or what else?