In PostgreSQL we can create arrays with the ARRAY
constructor. An array constructor is an expression that builds an array value using values for its member elements.
Tag: what is
An Overview of the GENERATE_SUBSCRIPTS() Function in PostgreSQL
PostgreSQL has a generate_subscripts()
function that generates a series comprising the valid subscripts of a given array.
We pass the array to the function, along with the dimension that we want to use. We also have the option of returning the series in reverse order.
Continue readingA Quick Overview of the ARRAY_SHUFFLE() Function in PostgreSQL
In PostgreSQL array_shuffle()
is a system function that randomly shuffles the first dimension of a given array.
The array_shuffle()
function was introduced in PostgreSQL 16, which was released on September 14th 2023.
An Introduction to the ARRAY_SAMPLE() Function in PostgreSQL
In PostgreSQL array_sample()
is a system function that returns an array of a specified number of items randomly selected from the given array.
The array_sample()
function was introduced in PostgreSQL 16, which was released on September 14th 2023.
An Overview of the DATE_SUBTRACT() Function in PostgreSQL
PostgreSQL 16 introduced the date_subtract()
function that allows us to subtract an interval from a timestamp with time zone.
It computes times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone
setting if that is omitted.
PostgreSQL DATE_ADD() Function Explained
PostgreSQL 16 introduced the date_add()
function that allows us to add an interval to a timestamp with time zone.
It computes times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone
setting if that is omitted.
SQLite’s json_valid() Now Accepts an Argument that Defines What “Valid” Means
SQLite’s json_valid()
function allows us to check whether a JSON string is well formed or not.
Prior to SQLite 3.45.0 the json_valid()
function only accepts one argument – the value to check. However, from SQLite 3.45.0 (released on 15 January 2024), we can now provide an optional second argument to define what valid – or “well formed” – means.
How Scheduled Events Deal with sql_mode in MySQL
When we create a scheduled event in MySQL, the current sql_mode
is stored with the event. That causes the event to use the sql_mode
that was in effect at the time the event was created. Same with altering an event.
Therefore, if we change the sql_mode
after the event was created or altered, it won’t have any impact on the event. In other words, we can safely change our system’s sql_mode
without worrying about whether it’s going to mess up any existing scheduled events.
Understanding Scheduled Events in MySQL
MySQL provides us with the ability to create scheduled events. These are tasks that run according to a specified schedule.
Often referred to simply as events, scheduled events can be created with the CREATE EVENT
statement, they can be modified with the ALTER EVENT
statement, and they can be removed with the DROP EVENT
statement.
A Quick Intro to SHOW BINLOG EVENTS in MySQL
In MySQL we can use the SHOW BINLOG EVENTS
statement to return a list of events in the binary log. We can specify which binary log to use, or we can let it default to the first one.