pgsql: Fix race in SSI interaction with empty btrees.

2023-07-03 Thread Thomas Munro
Fix race in SSI interaction with empty btrees. When predicate-locking btrees, we have a special case for completely empty btrees, since there is no page to lock. This was racy, because, without buffer lock held, a matching key could be inserted between the _bt_search() and the

pgsql: Fix race in SSI interaction with empty btrees.

2023-07-03 Thread Thomas Munro
Fix race in SSI interaction with empty btrees. When predicate-locking btrees, we have a special case for completely empty btrees, since there is no page to lock. This was racy, because, without buffer lock held, a matching key could be inserted between the _bt_search() and the

pgsql: Fix race in SSI interaction with empty btrees.

2023-07-03 Thread Thomas Munro
Fix race in SSI interaction with empty btrees. When predicate-locking btrees, we have a special case for completely empty btrees, since there is no page to lock. This was racy, because, without buffer lock held, a matching key could be inserted between the _bt_search() and the

pgsql: Fix race in SSI interaction with empty btrees.

2023-07-03 Thread Thomas Munro
Fix race in SSI interaction with empty btrees. When predicate-locking btrees, we have a special case for completely empty btrees, since there is no page to lock. This was racy, because, without buffer lock held, a matching key could be inserted between the _bt_search() and the

pgsql: Fix race in SSI interaction with empty btrees.

2023-07-03 Thread Thomas Munro
Fix race in SSI interaction with empty btrees. When predicate-locking btrees, we have a special case for completely empty btrees, since there is no page to lock. This was racy, because, without buffer lock held, a matching key could be inserted between the _bt_search() and the

pgsql: Fix race in SSI interaction with empty btrees.

2023-07-03 Thread Thomas Munro
Fix race in SSI interaction with empty btrees. When predicate-locking btrees, we have a special case for completely empty btrees, since there is no page to lock. This was racy, because, without buffer lock held, a matching key could be inserted between the _bt_search() and the

pgsql: Fix race in SSI interaction with empty btrees.

2023-07-03 Thread Thomas Munro
Fix race in SSI interaction with empty btrees. When predicate-locking btrees, we have a special case for completely empty btrees, since there is no page to lock. This was racy, because, without buffer lock held, a matching key could be inserted between the _bt_search() and the