pgsql: Reject cases where a query in WITH rewrites to just NOTIFY.

2021-07-09 Thread Tom Lane
Reject cases where a query in WITH rewrites to just NOTIFY. Since the executor can't cope with a utility statement appearing as a node of a plan tree, we can't support cases where a rewrite rule inserts a NOTIFY into an INSERT/UPDATE/DELETE command appearing in a WITH clause of a larger query. (O

pgsql: Reject cases where a query in WITH rewrites to just NOTIFY.

2021-07-09 Thread Tom Lane
Reject cases where a query in WITH rewrites to just NOTIFY. Since the executor can't cope with a utility statement appearing as a node of a plan tree, we can't support cases where a rewrite rule inserts a NOTIFY into an INSERT/UPDATE/DELETE command appearing in a WITH clause of a larger query. (O

pgsql: Reject cases where a query in WITH rewrites to just NOTIFY.

2021-07-09 Thread Tom Lane
Reject cases where a query in WITH rewrites to just NOTIFY. Since the executor can't cope with a utility statement appearing as a node of a plan tree, we can't support cases where a rewrite rule inserts a NOTIFY into an INSERT/UPDATE/DELETE command appearing in a WITH clause of a larger query. (O

pgsql: Reject cases where a query in WITH rewrites to just NOTIFY.

2021-07-09 Thread Tom Lane
Reject cases where a query in WITH rewrites to just NOTIFY. Since the executor can't cope with a utility statement appearing as a node of a plan tree, we can't support cases where a rewrite rule inserts a NOTIFY into an INSERT/UPDATE/DELETE command appearing in a WITH clause of a larger query. (O

pgsql: Reject cases where a query in WITH rewrites to just NOTIFY.

2021-07-09 Thread Tom Lane
Reject cases where a query in WITH rewrites to just NOTIFY. Since the executor can't cope with a utility statement appearing as a node of a plan tree, we can't support cases where a rewrite rule inserts a NOTIFY into an INSERT/UPDATE/DELETE command appearing in a WITH clause of a larger query. (O

pgsql: Reject cases where a query in WITH rewrites to just NOTIFY.

2021-07-09 Thread Tom Lane
Reject cases where a query in WITH rewrites to just NOTIFY. Since the executor can't cope with a utility statement appearing as a node of a plan tree, we can't support cases where a rewrite rule inserts a NOTIFY into an INSERT/UPDATE/DELETE command appearing in a WITH clause of a larger query. (O

pgsql: Reject cases where a query in WITH rewrites to just NOTIFY.

2021-07-09 Thread Tom Lane
Reject cases where a query in WITH rewrites to just NOTIFY. Since the executor can't cope with a utility statement appearing as a node of a plan tree, we can't support cases where a rewrite rule inserts a NOTIFY into an INSERT/UPDATE/DELETE command appearing in a WITH clause of a larger query. (O

pgsql: Update configure's probe for libldap to work with OpenLDAP 2.5.

2021-07-09 Thread Tom Lane
Update configure's probe for libldap to work with OpenLDAP 2.5. The separate libldap_r is gone and libldap itself is now always thread-safe. Unfortunately there seems no easy way to tell by inspection whether libldap is thread-safe, so we have to take it on faith that libldap is thread-safe if th

pgsql: Update configure's probe for libldap to work with OpenLDAP 2.5.

2021-07-09 Thread Tom Lane
Update configure's probe for libldap to work with OpenLDAP 2.5. The separate libldap_r is gone and libldap itself is now always thread-safe. Unfortunately there seems no easy way to tell by inspection whether libldap is thread-safe, so we have to take it on faith that libldap is thread-safe if th

pgsql: Update configure's probe for libldap to work with OpenLDAP 2.5.

2021-07-09 Thread Tom Lane
Update configure's probe for libldap to work with OpenLDAP 2.5. The separate libldap_r is gone and libldap itself is now always thread-safe. Unfortunately there seems no easy way to tell by inspection whether libldap is thread-safe, so we have to take it on faith that libldap is thread-safe if th

pgsql: Update configure's probe for libldap to work with OpenLDAP 2.5.

2021-07-09 Thread Tom Lane
Update configure's probe for libldap to work with OpenLDAP 2.5. The separate libldap_r is gone and libldap itself is now always thread-safe. Unfortunately there seems no easy way to tell by inspection whether libldap is thread-safe, so we have to take it on faith that libldap is thread-safe if th

pgsql: Update configure's probe for libldap to work with OpenLDAP 2.5.

2021-07-09 Thread Tom Lane
Update configure's probe for libldap to work with OpenLDAP 2.5. The separate libldap_r is gone and libldap itself is now always thread-safe. Unfortunately there seems no easy way to tell by inspection whether libldap is thread-safe, so we have to take it on faith that libldap is thread-safe if th

pgsql: Update configure's probe for libldap to work with OpenLDAP 2.5.

2021-07-09 Thread Tom Lane
Update configure's probe for libldap to work with OpenLDAP 2.5. The separate libldap_r is gone and libldap itself is now always thread-safe. Unfortunately there seems no easy way to tell by inspection whether libldap is thread-safe, so we have to take it on faith that libldap is thread-safe if th

pgsql: Update configure's probe for libldap to work with OpenLDAP 2.5.

2021-07-09 Thread Tom Lane
Update configure's probe for libldap to work with OpenLDAP 2.5. The separate libldap_r is gone and libldap itself is now always thread-safe. Unfortunately there seems no easy way to tell by inspection whether libldap is thread-safe, so we have to take it on faith that libldap is thread-safe if th

pgsql: Avoid creating a RESULT RTE that's marked LATERAL.

2021-07-09 Thread Tom Lane
Avoid creating a RESULT RTE that's marked LATERAL. Commit 7266d0997 added code to pull up simple constant function results, converting the RTE_FUNCTION RTE to a dummy RTE_RESULT RTE since it no longer need be scanned. But I forgot to clear the LATERAL flag if the RTE has it set. If the function

pgsql: Avoid creating a RESULT RTE that's marked LATERAL.

2021-07-09 Thread Tom Lane
Avoid creating a RESULT RTE that's marked LATERAL. Commit 7266d0997 added code to pull up simple constant function results, converting the RTE_FUNCTION RTE to a dummy RTE_RESULT RTE since it no longer need be scanned. But I forgot to clear the LATERAL flag if the RTE has it set. If the function

pgsql: Avoid creating a RESULT RTE that's marked LATERAL.

2021-07-09 Thread Tom Lane
Avoid creating a RESULT RTE that's marked LATERAL. Commit 7266d0997 added code to pull up simple constant function results, converting the RTE_FUNCTION RTE to a dummy RTE_RESULT RTE since it no longer need be scanned. But I forgot to clear the LATERAL flag if the RTE has it set. If the function

pgsql: Un-break AIX build.

2021-07-09 Thread Tom Lane
Un-break AIX build. In commit d0a02bdb8, I'd supposed that uniformly probing for ldap_bind would make the intent clearer. However, that seems not to work on AIX, for obscure reasons (maybe it's a macro there?). Revert to the former behavior of probing ldap_simple_bind for thread-safe cases and l

pgsql: Un-break AIX build.

2021-07-09 Thread Tom Lane
Un-break AIX build. In commit d0a02bdb8, I'd supposed that uniformly probing for ldap_bind would make the intent clearer. However, that seems not to work on AIX, for obscure reasons (maybe it's a macro there?). Revert to the former behavior of probing ldap_simple_bind for thread-safe cases and l

pgsql: Un-break AIX build.

2021-07-09 Thread Tom Lane
Un-break AIX build. In commit d0a02bdb8, I'd supposed that uniformly probing for ldap_bind would make the intent clearer. However, that seems not to work on AIX, for obscure reasons (maybe it's a macro there?). Revert to the former behavior of probing ldap_simple_bind for thread-safe cases and l

pgsql: Un-break AIX build.

2021-07-09 Thread Tom Lane
Un-break AIX build. In commit d0a02bdb8, I'd supposed that uniformly probing for ldap_bind would make the intent clearer. However, that seems not to work on AIX, for obscure reasons (maybe it's a macro there?). Revert to the former behavior of probing ldap_simple_bind for thread-safe cases and l

pgsql: Un-break AIX build.

2021-07-09 Thread Tom Lane
Un-break AIX build. In commit d0a02bdb8, I'd supposed that uniformly probing for ldap_bind would make the intent clearer. However, that seems not to work on AIX, for obscure reasons (maybe it's a macro there?). Revert to the former behavior of probing ldap_simple_bind for thread-safe cases and l

pgsql: Un-break AIX build.

2021-07-09 Thread Tom Lane
Un-break AIX build. In commit d0a02bdb8, I'd supposed that uniformly probing for ldap_bind would make the intent clearer. However, that seems not to work on AIX, for obscure reasons (maybe it's a macro there?). Revert to the former behavior of probing ldap_simple_bind for thread-safe cases and l

pgsql: Un-break AIX build.

2021-07-09 Thread Tom Lane
Un-break AIX build. In commit d0a02bdb8, I'd supposed that uniformly probing for ldap_bind would make the intent clearer. However, that seems not to work on AIX, for obscure reasons (maybe it's a macro there?). Revert to the former behavior of probing ldap_simple_bind for thread-safe cases and l

pgsql: Eliminate replication protocol error related to IDENTIFY_SYSTEM.

2021-07-09 Thread Jeff Davis
Eliminate replication protocol error related to IDENTIFY_SYSTEM. The requirement that IDENTIFY_SYSTEM be run before START_REPLICATION was both undocumented and unnecessary. Remove the error and ensure that ThisTimeLineID is initialized in START_REPLICATION. Elect not to backport because this requ

pgsql: libpq: Fix sending queries in pipeline aborted state

2021-07-09 Thread Alvaro Herrera
libpq: Fix sending queries in pipeline aborted state When sending queries in pipeline mode, we were careless about leaving the connection in the right state so that PQgetResult would behave correctly; trying to read further results after sending a query after having read a result with an error wou

pgsql: libpq: Fix sending queries in pipeline aborted state

2021-07-09 Thread Alvaro Herrera
libpq: Fix sending queries in pipeline aborted state When sending queries in pipeline mode, we were careless about leaving the connection in the right state so that PQgetResult would behave correctly; trying to read further results after sending a query after having read a result with an error wou

pgsql: Un-break AIX build, take 2.

2021-07-09 Thread Tom Lane
Un-break AIX build, take 2. I incorrectly diagnosed the reason why hoverfly is unhappy. Looking closer, it appears that it fails to link libldap unless libssl is also present; so the problem was my idea of clearing LIBS before making the check. Revert to essentially the original coding, except th

pgsql: Un-break AIX build, take 2.

2021-07-09 Thread Tom Lane
Un-break AIX build, take 2. I incorrectly diagnosed the reason why hoverfly is unhappy. Looking closer, it appears that it fails to link libldap unless libssl is also present; so the problem was my idea of clearing LIBS before making the check. Revert to essentially the original coding, except th

pgsql: Un-break AIX build, take 2.

2021-07-09 Thread Tom Lane
Un-break AIX build, take 2. I incorrectly diagnosed the reason why hoverfly is unhappy. Looking closer, it appears that it fails to link libldap unless libssl is also present; so the problem was my idea of clearing LIBS before making the check. Revert to essentially the original coding, except th

pgsql: Un-break AIX build, take 2.

2021-07-09 Thread Tom Lane
Un-break AIX build, take 2. I incorrectly diagnosed the reason why hoverfly is unhappy. Looking closer, it appears that it fails to link libldap unless libssl is also present; so the problem was my idea of clearing LIBS before making the check. Revert to essentially the original coding, except th

pgsql: Un-break AIX build, take 2.

2021-07-09 Thread Tom Lane
Un-break AIX build, take 2. I incorrectly diagnosed the reason why hoverfly is unhappy. Looking closer, it appears that it fails to link libldap unless libssl is also present; so the problem was my idea of clearing LIBS before making the check. Revert to essentially the original coding, except th

pgsql: Un-break AIX build, take 2.

2021-07-09 Thread Tom Lane
Un-break AIX build, take 2. I incorrectly diagnosed the reason why hoverfly is unhappy. Looking closer, it appears that it fails to link libldap unless libssl is also present; so the problem was my idea of clearing LIBS before making the check. Revert to essentially the original coding, except th

pgsql: Un-break AIX build, take 2.

2021-07-09 Thread Tom Lane
Un-break AIX build, take 2. I incorrectly diagnosed the reason why hoverfly is unhappy. Looking closer, it appears that it fails to link libldap unless libssl is also present; so the problem was my idea of clearing LIBS before making the check. Revert to essentially the original coding, except th