On 16th of October 2023, Alexander Korotkov committed patch:
Add support event triggers on authenticated login
This commit introduces trigger on login event, allowing to fire some actions
right on the user connection. This can be useful for logging or connection
check purposes as well as for some personalization of environment. Usage
details are described in the documentation included, but shortly usage is
the same as for other triggers: create function returning event_trigger and
then create event trigger on login event.
In order to prevent the connection time overhead when there are no triggers
the commit introduces pg_database.dathasloginevt flag, which indicates database
has active login triggers. This flag is set by CREATE/ALTER EVENT TRIGGER
command, and unset at connection time when no active triggers found.
Author: Konstantin Knizhnik, Mikhail Gribkov
Reviewed-by: Pavel Stehule, Takayuki Tsunakawa, Greg Nancarrow, Ivan Panchenko
Reviewed-by: Daniel Gustafsson, Teodor Sigaev, Robert Haas, Andres Freund
Reviewed-by: Tom Lane, Andrey Sokolov, Zhihong Yu, Sergey Shinderuk
Reviewed-by: Gregory Stark, Nikita Malakhov, Ted Yu
Continue reading Waiting for PostgreSQL 17 – Add support event triggers on authenticated login
On 29th of August 2023, Daniel Gustafsson committed patch:
Allow \watch queries to stop on minimum rows returned
When running a repeat query with \watch in psql, it can be
helpful to be able to stop the watch process when the query
no longer returns the expected amount of rows. An example
would be to watch for the presence of a certain event in
pg_stat_activity and stopping when the event is no longer
present, or to watch an index creation and stop when the
index is created.
This adds a min_rows=MIN parameter to \watch which can be
set to a non-negative integer, and the watch query will
stop executing when it returns less than MIN rows.
Author: Greg Sabino Mullane <firstname.lastname@example.org>
Reviewed-by: Michael Paquier <email@example.com>
Reviewed-by: Daniel Gustafsson <firstname.lastname@example.org>
Continue reading Waiting for PostgreSQL 17 – Allow \watch queries to stop on minimum rows returned
On 26th of August 2023, Michael Paquier committed patch:
Generate new LOG for "trust" connections under log_connections
Adding an extra LOG for connections that have not set an authn ID, like
when the "trust" authentication method is used, is useful for audit
A couple of TAP tests for SSL and authentication need to be tweaked to
adapt to this new LOG generated, as some scenarios expected no logs but
they now get a hit.
Reported-by: Shaun Thomas
Author: Jacob Champion
Reviewed-by: Robert Haas, Michael Paquier
Continue reading Waiting for PostgreSQL 17 – Generate new LOG for “trust" connections under log_connections
On 23rd of August 2023, Nathan Bossart committed patch:
Add to_bin() and to_oct().
This commit introduces functions for converting numbers to their
equivalent binary and octal representations. Also, the base
conversion code for these functions and to_hex() has been moved to
a common helper function.
Co-authored-by: Eric Radman
Reviewed-by: Ian Barwick, Dag Lem, Vignesh C, Tom Lane, Peter Eisentraut, Kirk Wolak, Vik Fearing, John Naylor, Dean Rasheed
Continue reading Waiting for PostgreSQL 17 – Add to_bin() and to_oct().
On 7th of April 2023, Tom Lane committed patch:
Add array_sample() and array_shuffle() functions.
These are useful in Monte Carlo applications.
Martin Kalcher, reviewed/adjusted by Daniel Gustafsson and myself
Continue reading Waiting for PostgreSQL 16 – Add array_sample() and array_shuffle() functions.
On 11st of February 2023, Andres Freund committed patch:
Add pg_stat_io view, providing more detailed IO statistics
Builds on 28e626bde00 and f30d62c2fc6. See the former for motivation.
Rows of the view show IO operations for a particular backend type, IO target
object, IO context combination (e.g. a client backend's operations on
permanent relations in shared buffers) and each column in the view is the
total number of IO Operations done (e.g. writes). So a cell in the view would
be, for example, the number of blocks of relation data written from shared
buffers by client backends since the last stats reset.
In anticipation of tracking WAL IO and non-block-oriented IO (such as
temporary file IO), the "op_bytes" column specifies the unit of the "reads",
"writes", and "extends" columns for a given row.
Rows for combinations of IO operation, backend type, target object and context
that never occur, are ommitted entirely. For example, checkpointer will never
operate on temporary relations.
Similarly, if an IO operation never occurs for such a combination, the IO
operation's cell will be null, to distinguish from 0 observed IO
operations. For example, bgwriter should not perform reads.
Note that some of the cells in the view are redundant with fields in
pg_stat_bgwriter (e.g. buffers_backend). For now, these have been kept for
Author: Melanie Plageman <email@example.com>
Author: Samay Sharma <firstname.lastname@example.org>
Reviewed-by: Maciek Sakrejda <email@example.com>
Reviewed-by: Lukas Fittl <firstname.lastname@example.org>
Reviewed-by: Andres Freund <email@example.com>
Reviewed-by: Justin Pryzby <firstname.lastname@example.org>
Continue reading Waiting for PostgreSQL 16 – Add pg_stat_io view, providing more detailed IO statistics
On 4th of February 2023, Dean Rasheed committed patch:
Allow underscores in integer and numeric constants.
This allows underscores to be used in integer and numeric literals,
and their corresponding type input functions, for visual grouping.
A single underscore is allowed between any 2 digits, or immediately
after the base prefix indicator of non-decimal integers, per SQL:202x
Peter Eisentraut and Dean Rasheed
Continue reading Waiting for PostgreSQL 16 – Allow underscores in integer and numeric constants.
On 9th of January 2023, Tom Lane committed patch:
Invent random_normal() to provide normally-distributed random numbers.
There is already a version of this in contrib/tablefunc, but it
seems sufficiently widely useful to justify having it in core.
Continue reading Waiting for PostgreSQL 16 – Invent random_normal() to provide normally-distributed random numbers.
On 14th of December 2022, Peter Eisentraut committed patch:
Non-decimal integer literals
Add support for hexadecimal, octal, and binary integer literals:
per SQL:202x draft.
This adds support in the lexer as well as in the integer type input
Reviewed-by: John Naylor <email@example.com>
Reviewed-by: Zhihong Yu <firstname.lastname@example.org>
Reviewed-by: David Rowley <email@example.com>
Reviewed-by: Dean Rasheed <firstname.lastname@example.org>
Continue reading Waiting for PostgreSQL 16 – Non-decimal integer literals
On 14th of December 2022, Jeff Davis committed patch:
Add grantable MAINTAIN privilege and pg_maintain role.
Allows VACUUM, ANALYZE, REINDEX, REFRESH MATERIALIZED VIEW, CLUSTER,
and LOCK TABLE.
Effectively reverts 4441fc704d. Instead of creating separate
privileges for VACUUM, ANALYZE, and other maintenance commands, group
them together under a single MAINTAIN privilege.
Author: Nathan Bossart
Continue reading Waiting for PostgreSQL 16 – Add grantable MAINTAIN privilege and pg_maintain role.