Re: [HACKERS] Odd behavior with PG_TRY - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] Odd behavior with PG_TRY
Date
Msg-id CAB7nPqS8mVqFd9mw84UbaofaiXrfd0pgRfeZrhbL8DMdHJayTA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Odd behavior with PG_TRY  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [HACKERS] Odd behavior with PG_TRY  (Kevin Grittner <kgrittn@gmail.com>)
List pgsql-hackers
On Thu, Jan 5, 2017 at 7:10 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> Memory contexts used in catch block also doesn't seem to be marked as
> volatile, you might want to try by marking them as volatile.  Also, it
> might worth trying it on some other system to see if you are by any
> chance hitting the problem similar to what Tom has faced.

If a variable is modified within PG_TRY and then referenced in
PG_CATCH it needs to be marked as volatile to be strictly in
conformance with POSIX. This also ensures that any compiler does not
do any stupid optimizations with those variables in the way they are
referenced and used.
-- 
Michael



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: [HACKERS] Parallel Append implementation
Next
From: Ashutosh Bapat
Date:
Subject: Re: [HACKERS] postgres_fdw : altering foreign table not invalidatingprepare statement execution plan.