[COMMITTERS] pgsql: Be more careful about Python refcounts while creating exception

2016-12-09 Thread Tom Lane
Be more careful about Python refcounts while creating exception objects. PLy_generate_spi_exceptions neglected to do Py_INCREF on the new exception objects, evidently supposing that PyModule_AddObject would do that --- but it doesn't. This left us in a situation where a Python garbage collection

[COMMITTERS] pgsql: Be more careful about Python refcounts while creating exception

2016-12-09 Thread Tom Lane
Be more careful about Python refcounts while creating exception objects. PLy_generate_spi_exceptions neglected to do Py_INCREF on the new exception objects, evidently supposing that PyModule_AddObject would do that --- but it doesn't. This left us in a situation where a Python garbage collection

[COMMITTERS] pgsql: Be more careful about Python refcounts while creating exception

2016-12-09 Thread Tom Lane
Be more careful about Python refcounts while creating exception objects. PLy_generate_spi_exceptions neglected to do Py_INCREF on the new exception objects, evidently supposing that PyModule_AddObject would do that --- but it doesn't. This left us in a situation where a Python garbage collection

[COMMITTERS] pgsql: Be more careful about Python refcounts while creating exception

2016-12-09 Thread Tom Lane
Be more careful about Python refcounts while creating exception objects. PLy_generate_spi_exceptions neglected to do Py_INCREF on the new exception objects, evidently supposing that PyModule_AddObject would do that --- but it doesn't. This left us in a situation where a Python garbage collection

[COMMITTERS] pgsql: Be more careful about Python refcounts while creating exception

2016-12-09 Thread Tom Lane
Be more careful about Python refcounts while creating exception objects. PLy_generate_spi_exceptions neglected to do Py_INCREF on the new exception objects, evidently supposing that PyModule_AddObject would do that --- but it doesn't. This left us in a situation where a Python garbage collection

[COMMITTERS] pgsql: Be more careful about Python refcounts while creating exception

2016-12-09 Thread Tom Lane
Be more careful about Python refcounts while creating exception objects. PLy_generate_spi_exceptions neglected to do Py_INCREF on the new exception objects, evidently supposing that PyModule_AddObject would do that --- but it doesn't. This left us in a situation where a Python garbage collection

[COMMITTERS] pgsql: Fix reporting of column typmods for multi-row VALUES constructs.

2016-12-09 Thread Tom Lane
Fix reporting of column typmods for multi-row VALUES constructs. expandRTE() and get_rte_attribute_type() reported the exprType() and exprTypmod() values of the expressions in the first row of the VALUES as being the column type/typmod returned by the VALUES RTE. That's fine for the data type, si

[COMMITTERS] pgsql: Fix reporting of column typmods for multi-row VALUES constructs.

2016-12-09 Thread Tom Lane
Fix reporting of column typmods for multi-row VALUES constructs. expandRTE() and get_rte_attribute_type() reported the exprType() and exprTypmod() values of the expressions in the first row of the VALUES as being the column type/typmod returned by the VALUES RTE. That's fine for the data type, si

[COMMITTERS] pgsql: Fix reporting of column typmods for multi-row VALUES constructs.

2016-12-09 Thread Tom Lane
Fix reporting of column typmods for multi-row VALUES constructs. expandRTE() and get_rte_attribute_type() reported the exprType() and exprTypmod() values of the expressions in the first row of the VALUES as being the column type/typmod returned by the VALUES RTE. That's fine for the data type, si

[COMMITTERS] pgsql: Fix reporting of column typmods for multi-row VALUES constructs.

2016-12-09 Thread Tom Lane
Fix reporting of column typmods for multi-row VALUES constructs. expandRTE() and get_rte_attribute_type() reported the exprType() and exprTypmod() values of the expressions in the first row of the VALUES as being the column type/typmod returned by the VALUES RTE. That's fine for the data type, si

[COMMITTERS] pgsql: Fix reporting of column typmods for multi-row VALUES constructs.

2016-12-09 Thread Tom Lane
Fix reporting of column typmods for multi-row VALUES constructs. expandRTE() and get_rte_attribute_type() reported the exprType() and exprTypmod() values of the expressions in the first row of the VALUES as being the column type/typmod returned by the VALUES RTE. That's fine for the data type, si

[COMMITTERS] pgsql: Fix crasher bug in array_position(s)

2016-12-09 Thread Alvaro Herrera
Fix crasher bug in array_position(s) array_position and its cousin array_positions were caching the element type equality function's FmgrInfo without being careful enough to put it in a long-lived context. This is obviously broken but it didn't matter in most cases; only when using arrays of reco

[COMMITTERS] pgsql: Fix crasher bug in array_position(s)

2016-12-09 Thread Alvaro Herrera
Fix crasher bug in array_position(s) array_position and its cousin array_positions were caching the element type equality function's FmgrInfo without being careful enough to put it in a long-lived context. This is obviously broken but it didn't matter in most cases; only when using arrays of reco

[COMMITTERS] pgsql: Fix crasher bug in array_position(s)

2016-12-09 Thread Alvaro Herrera
Fix crasher bug in array_position(s) array_position and its cousin array_positions were caching the element type equality function's FmgrInfo without being careful enough to put it in a long-lived context. This is obviously broken but it didn't matter in most cases; only when using arrays of reco