Tom Lane wrote:
Heikki Linnakangas <heikki.linnakan...@enterprisedb.com> writes:
I think we should instead try to break the PANIC cycle. If we exceed ERRORDATA_STACK_SIZE, and we're already PANICing, we should just die immediately instead of throwing another PANIC about exceeding the stack size. The attached patch does that.

I don't think that's an improvement.

I'm not sure exactly why the previous fix for this type of problem
failed to cover this case --- did you identify why?

When the conversion function throws an ERROR, we try to send the error message to the client. As part of that, we try to convert the text "ERROR" to the client encoding (pq_sendstring does that). That calls the conversion function again, which errors again, lathe, rinse, repeat. until ERRORDATA_STACK_SIZE is reached. At that point, the same happens with the text "PANIC", until ERRORDATA_STACK_SIZE is reached again, and then we get into an endless recursion.

When the conversion function doesn't work, any attempt to send any text to the client will fail.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to