The current noticeReceiver and noticeProcessor use lua functions that may fail and longjmp out.
One option is to lua_pcall out to a second function.
- This could make it easier to add coroutine support (via
lua_pcallk)
Alternatively, only use functions that can't fail.
- use a unique pointer and
lua_rawgetp instead of lua_pushstring+lua_rawget
- preallocate the
PGresult *
- never call
luaL_error
- A
PQnoticeReceiver is by definition called for warnings or below, so it's not supposed to fail