Re: odd behavior/possible bug (Was: Re: PG10 partitioning - odd behavior/possible bug)

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: odd behavior/possible bug (Was: Re: PG10 partitioning - odd behavior/possible bug)
Date: 2017-09-04 00:01:14
Message-ID: c4a7c1d4-4268-5952-c013-8c16da6018b9@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/03/2017 03:34 PM, Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
>> Notice that tsr is not empty at all on the first loop, but on the second
>> loop it is empty every second time the trigger fires.
>
> I think the issue is that now() isn't changing within the transaction,
> so when you construct "tstzrange(lower(OLD.tr), now(), '[)')" using an
> old row whose "lower(OLD.tr)" is already "now()", you get an empty range.
> Probably using '[]' bounds would avoid the oddness.

Hmmm, good point. Sorry for the noise.

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-09-04 01:04:06 Re: expanding inheritance in partition bound order
Previous Message Tom Lane 2017-09-03 22:34:26 Re: odd behavior/possible bug (Was: Re: PG10 partitioning - odd behavior/possible bug)