Re: odd behavior/possible bug (Was: Re: [HACKERS] PG10 partitioning - odd behavior/possible bug) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: odd behavior/possible bug (Was: Re: [HACKERS] PG10 partitioning - odd behavior/possible bug)
Date
Msg-id 20986.1504478066@sss.pgh.pa.us
Whole thread Raw
In response to odd behavior/possible bug (Was: Re: [HACKERS] PG10 partitioning - oddbehavior/possible bug)  (Joe Conway <mail@joeconway.com>)
Responses Re: odd behavior/possible bug (Was: Re: [HACKERS] PG10 partitioning -odd behavior/possible bug)
List pgsql-hackers
Joe Conway <mail@joeconway.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.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: odd behavior/possible bug (Was: Re: [HACKERS] PG10 partitioning - oddbehavior/possible bug)
Next
From: Joe Conway
Date:
Subject: Re: odd behavior/possible bug (Was: Re: [HACKERS] PG10 partitioning -odd behavior/possible bug)