pgsql: Fix checking of query type in plpgsql's RETURN QUERY command.

2021-10-03 Thread Tom Lane
Fix checking of query type in plpgsql's RETURN QUERY command. Prior to v14, we insisted that the query in RETURN QUERY be of a type that returns tuples. (For instance, INSERT RETURNING was allowed, but not plain INSERT.) That happened indirectly because we opened a cursor for the query, so spi.c

pgsql: Fix checking of query type in plpgsql's RETURN QUERY command.

2021-10-03 Thread Tom Lane
Fix checking of query type in plpgsql's RETURN QUERY command. Prior to v14, we insisted that the query in RETURN QUERY be of a type that returns tuples. (For instance, INSERT RETURNING was allowed, but not plain INSERT.) That happened indirectly because we opened a cursor for the query, so spi.c

pgsql: Fix snapshot builds during promotion of hot standby node with 2P

2021-10-03 Thread Michael Paquier
Fix snapshot builds during promotion of hot standby node with 2PC Some specific logic is done at the end of recovery when involving 2PC transactions: 1) Call RecoverPreparedTransactions(), to recover the state of 2PC transactions into memory (re-acquire locks, etc.). 2) ShutdownRecoveryTransaction

pgsql: Fix snapshot builds during promotion of hot standby node with 2P

2021-10-03 Thread Michael Paquier
Fix snapshot builds during promotion of hot standby node with 2PC Some specific logic is done at the end of recovery when involving 2PC transactions: 1) Call RecoverPreparedTransactions(), to recover the state of 2PC transactions into memory (re-acquire locks, etc.). 2) ShutdownRecoveryTransaction

pgsql: Fix snapshot builds during promotion of hot standby node with 2P

2021-10-03 Thread Michael Paquier
Fix snapshot builds during promotion of hot standby node with 2PC Some specific logic is done at the end of recovery when involving 2PC transactions: 1) Call RecoverPreparedTransactions(), to recover the state of 2PC transactions into memory (re-acquire locks, etc.). 2) ShutdownRecoveryTransaction

pgsql: Fix snapshot builds during promotion of hot standby node with 2P

2021-10-03 Thread Michael Paquier
Fix snapshot builds during promotion of hot standby node with 2PC Some specific logic is done at the end of recovery when involving 2PC transactions: 1) Call RecoverPreparedTransactions(), to recover the state of 2PC transactions into memory (re-acquire locks, etc.). 2) ShutdownRecoveryTransaction

pgsql: Fix snapshot builds during promotion of hot standby node with 2P

2021-10-03 Thread Michael Paquier
Fix snapshot builds during promotion of hot standby node with 2PC Some specific logic is done at the end of recovery when involving 2PC transactions: 1) Call RecoverPreparedTransactions(), to recover the state of 2PC transactions into memory (re-acquire locks, etc.). 2) ShutdownRecoveryTransaction

pgsql: Fix snapshot builds during promotion of hot standby node with 2P

2021-10-03 Thread Michael Paquier
Fix snapshot builds during promotion of hot standby node with 2PC Some specific logic is done at the end of recovery when involving 2PC transactions: 1) Call RecoverPreparedTransactions(), to recover the state of 2PC transactions into memory (re-acquire locks, etc.). 2) ShutdownRecoveryTransaction

pgsql: Fix snapshot builds during promotion of hot standby node with 2P

2021-10-03 Thread Michael Paquier
Fix snapshot builds during promotion of hot standby node with 2PC Some specific logic is done at the end of recovery when involving 2PC transactions: 1) Call RecoverPreparedTransactions(), to recover the state of 2PC transactions into memory (re-acquire locks, etc.). 2) ShutdownRecoveryTransaction