Hello
This reminded me of some very old bug reports, like mine:
https://www.postgresql.org/message-id/15431-7a89470f7879bed4%40postgresql.org
Still reproduces giving different results depending on the order of operations. The proposed patch makes the behavior
thesame in both cases.
Since this code path may be reachable by the user, instead of elog there should be ereport with a more user-friendly
description.I would suggest something more like the text used for btree in a case like this. (ereport in
_bt_check_third_page)
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("index row size %zu exceeds gist maximum %zu for index \"%s\""...
errdetail("Index row references tuple (%u,%u) in relation \"%s\".",...
errhint("Values larger than 1/2 of a buffer page cannot be indexed"...
regards, Sergei