pgsql: Add test coverage for EXTRACT()

2020-06-13 Thread Peter Eisentraut
Add test coverage for EXTRACT() The variants for time and timetz had zero test coverage, the variant for interval only very little. This adds practically full coverage for those functions. Reviewed-by: Vik Fearing Reviewed-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/c3

pgsql: Replace superuser check by ACLs for replication origin functions

2020-06-13 Thread Michael Paquier
Replace superuser check by ACLs for replication origin functions This patch removes the hardcoded check for superuser privileges when executing replication origin functions. Instead, execution is revoked from public, meaning that those functions can be executed by a superuser and that access to t

pgsql: Sync behavior of var_samp and stddev_samp for single NaN inputs.

2020-06-13 Thread Tom Lane
Sync behavior of var_samp and stddev_samp for single NaN inputs. var_samp(numeric) and stddev_samp(numeric) disagreed with their float cousins about what to do for a single non-null input value that is NaN. The float versions return NULL on the grounds that the calculation is only defined for more

pgsql: Fix behavior of float aggregates for single Inf or NaN inputs.

2020-06-13 Thread Tom Lane
Fix behavior of float aggregates for single Inf or NaN inputs. When there is just one non-null input value, and it is infinity or NaN, aggregates such as stddev_pop and covar_pop should produce a NaN result, because the calculation is not well-defined. They used to do so, but since we adopted You

pgsql: Fix behavior of float aggregates for single Inf or NaN inputs.

2020-06-13 Thread Tom Lane
Fix behavior of float aggregates for single Inf or NaN inputs. When there is just one non-null input value, and it is infinity or NaN, aggregates such as stddev_pop and covar_pop should produce a NaN result, because the calculation is not well-defined. They used to do so, but since we adopted You

pgsql: Fix behavior of float aggregates for single Inf or NaN inputs.

2020-06-13 Thread Tom Lane
Fix behavior of float aggregates for single Inf or NaN inputs. When there is just one non-null input value, and it is infinity or NaN, aggregates such as stddev_pop and covar_pop should produce a NaN result, because the calculation is not well-defined. They used to do so, but since we adopted You

pgsql: Silence _bt_check_unique compiler warning.

2020-06-13 Thread Peter Geoghegan
Silence _bt_check_unique compiler warning. Reported-By: Tom Lane Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d64f1cdf2f4bef1454c74af1028c9ea0c3280322 Modified Files -- src/backend/acces

pgsql: Silence _bt_check_unique compiler warning.

2020-06-13 Thread Peter Geoghegan
Silence _bt_check_unique compiler warning. Reported-By: Tom Lane Discussion: https://postgr.es/m/[email protected] Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/e745bcc00149fe3c35ba1123800e0beb948e3678 Modified Files -- src/backen

pgsql: Grammar object type refactoring

2020-06-13 Thread Peter Eisentraut
Grammar object type refactoring Unify the grammar of COMMENT, DROP, and SECURITY LABEL further. They all effectively just take an object address for later processing, so we can make the grammar more generalized. Some extra checking about which object types are supported can be done later in the

pgsql: Refactor AlterExtensionContentsStmt grammar

2020-06-13 Thread Peter Eisentraut
Refactor AlterExtensionContentsStmt grammar Make use of the general object support already used by COMMENT, DROP, and SECURITY LABEL. Discussion: https://www.postgresql.org/message-id/flat/163c00a5-f634-ca52-fc7c-0e53deda8735%402ndquadrant.com Branch -- master Details --- https://git.p