pgsql: Add more columns to pg_stat_ssl

2019-01-31 Thread Peter Eisentraut
Add more columns to pg_stat_ssl

Add columns client_serial and issuer_dn to pg_stat_ssl.  These allow
uniquely identifying the client certificate.

Rename the existing column clientdn to client_dn, to make the naming
more consistent and easier to read.

Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]/

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/f60a0e96778854ed0b7fd4737488ba88022e47bd

Modified Files
--
doc/src/sgml/monitoring.sgml  | 20 ++--
src/backend/catalog/system_views.sql  |  4 +++-
src/backend/libpq/be-secure-openssl.c | 31 ++-
src/backend/postmaster/pgstat.c   |  4 +++-
src/backend/utils/adt/pgstatfuncs.c   | 22 ++
src/include/catalog/catversion.h  |  2 +-
src/include/catalog/pg_proc.dat   |  6 +++---
src/include/libpq/libpq-be.h  |  4 +++-
src/include/pgstat.h  | 16 +---
src/test/regress/expected/rules.out   | 10 ++
src/test/ssl/t/001_ssltests.pl|  8 
11 files changed, 102 insertions(+), 25 deletions(-)



pgsql: Fix use of dangling pointer in heap_delete() when logging replic

2019-01-31 Thread Michael Paquier
Fix use of dangling pointer in heap_delete() when logging replica identity

When logging the replica identity of a deleted tuple, XLOG_HEAP_DELETE
records include references of the old tuple.  Its data is stored in an
intermediate variable used to register this information for the WAL
record, but this variable gets away from the stack when the record gets
actually inserted.

Spotted by clang's AddressSanitizer.

Author: Stas Kelvish
Discussion: 
https://postgr.es/m/[email protected]
Backpatch-through: 9.4

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/eb8c9f0bc394160efd6951c69e644551e835a486

Modified Files
--
src/backend/access/heap/heapam.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



pgsql: Fix use of dangling pointer in heap_delete() when logging replic

2019-01-31 Thread Michael Paquier
Fix use of dangling pointer in heap_delete() when logging replica identity

When logging the replica identity of a deleted tuple, XLOG_HEAP_DELETE
records include references of the old tuple.  Its data is stored in an
intermediate variable used to register this information for the WAL
record, but this variable gets away from the stack when the record gets
actually inserted.

Spotted by clang's AddressSanitizer.

Author: Stas Kelvish
Discussion: 
https://postgr.es/m/[email protected]
Backpatch-through: 9.4

Branch
--
REL_11_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/47412e075266a5f23c66aaaf3abbb76b075c2c15

Modified Files
--
src/backend/access/heap/heapam.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



pgsql: Fix use of dangling pointer in heap_delete() when logging replic

2019-01-31 Thread Michael Paquier
Fix use of dangling pointer in heap_delete() when logging replica identity

When logging the replica identity of a deleted tuple, XLOG_HEAP_DELETE
records include references of the old tuple.  Its data is stored in an
intermediate variable used to register this information for the WAL
record, but this variable gets away from the stack when the record gets
actually inserted.

Spotted by clang's AddressSanitizer.

Author: Stas Kelvish
Discussion: 
https://postgr.es/m/[email protected]
Backpatch-through: 9.4

Branch
--
REL9_4_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/05d24cf7ca7aae4f6842dfbd0962a9d04511ba78

Modified Files
--
src/backend/access/heap/heapam.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



pgsql: Fix use of dangling pointer in heap_delete() when logging replic

2019-01-31 Thread Michael Paquier
Fix use of dangling pointer in heap_delete() when logging replica identity

When logging the replica identity of a deleted tuple, XLOG_HEAP_DELETE
records include references of the old tuple.  Its data is stored in an
intermediate variable used to register this information for the WAL
record, but this variable gets away from the stack when the record gets
actually inserted.

Spotted by clang's AddressSanitizer.

Author: Stas Kelvish
Discussion: 
https://postgr.es/m/[email protected]
Backpatch-through: 9.4

Branch
--
REL9_6_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/014763e97668d1597d3cc2abe9ec4bdbf1554e5f

Modified Files
--
src/backend/access/heap/heapam.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



pgsql: Fix use of dangling pointer in heap_delete() when logging replic

2019-01-31 Thread Michael Paquier
Fix use of dangling pointer in heap_delete() when logging replica identity

When logging the replica identity of a deleted tuple, XLOG_HEAP_DELETE
records include references of the old tuple.  Its data is stored in an
intermediate variable used to register this information for the WAL
record, but this variable gets away from the stack when the record gets
actually inserted.

Spotted by clang's AddressSanitizer.

Author: Stas Kelvish
Discussion: 
https://postgr.es/m/[email protected]
Backpatch-through: 9.4

Branch
--
REL9_5_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/90f1ba7ecf01f063c0e113c72afcf8c1a64ca285

Modified Files
--
src/backend/access/heap/heapam.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



pgsql: Fix use of dangling pointer in heap_delete() when logging replic

2019-01-31 Thread Michael Paquier
Fix use of dangling pointer in heap_delete() when logging replica identity

When logging the replica identity of a deleted tuple, XLOG_HEAP_DELETE
records include references of the old tuple.  Its data is stored in an
intermediate variable used to register this information for the WAL
record, but this variable gets away from the stack when the record gets
actually inserted.

Spotted by clang's AddressSanitizer.

Author: Stas Kelvish
Discussion: 
https://postgr.es/m/[email protected]
Backpatch-through: 9.4

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/478e0069fb8bc30d7e0c1a8fc390ed041e1b67c9

Modified Files
--
src/backend/access/heap/heapam.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



pgsql: Adjust comment about timeout when waiting for WAL at recovery

2019-01-31 Thread Michael Paquier
Adjust comment about timeout when waiting for WAL at recovery

A timeout of 5s is used when waiting for WAL to become available at
recovery so as the startup process is able to react promptly if a
trigger file shows up.  However this missed the fact that the startup
process also relies on the timeout to check periodically the status of
any active WAL receiver.

Discussion: https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/c93001b3f957994942ea18ed261ae06ac507ea95

Modified Files
--
src/backend/access/transam/xlog.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)