restoring user id and SecContext before logging error in ri_PlanCheck - Mailing list pgsql-hackers

From Zhihong Yu
Subject restoring user id and SecContext before logging error in ri_PlanCheck
Date
Msg-id CALNJ-vQJKNR45GZDRuu7xLFfBYVT2pY7ywYKMnu0qrvaC7uUow@mail.gmail.com
Whole thread Raw
Responses Re: restoring user id and SecContext before logging error in ri_PlanCheck
List pgsql-hackers
Hi,
I was looking at the code in ri_PlanCheck of src/backend/utils/adt/ri_triggers.c starting at line 2289.

When qplan is NULL, we log an error. This would skip calling SetUserIdAndSecContext().

I think the intention of the code should be restoring user id and SecContext regardless of the outcome from SPI_prepare().

If my understanding is correct, please take a look at the patch.

Thanks

pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Temporary tables versus wraparound... again
Next
From: Zhihong Yu
Date:
Subject: Re: restoring user id and SecContext before logging error in ri_PlanCheck