Often in PostgreSQL you may want to extract a specific value from an XML tag. You can use the xpath() function with the following syntax…
Author: Zach
Often in PostgreSQL you may want to create a timestamp that represents the start of the day for a particular date. You can use the…
Often in PostgreSQL you may want to get the file extension from a string column that contains a filename. You can use the following syntax…
Often in PostgreSQL you may want to update a single property value in a JSONB column. You can use the following basic syntax to do…
Often in PostgreSQL you may want to calculate the average of values in a timestamp column. You can use the following syntax to do so:…
Often in PostgreSQL you may want to select a timestamp without the seconds. You can use the date_trunc() function with the following syntax to do…
Often in PostgreSQL you may want to convert a text column to an array. You can use the string_to_array() function with the following syntax to…
Often in PostgreSQL you may want to select a random row from each group in a table. You can use the following syntax to do…
Often in PostgreSQL you may want to swap the values of two columns. You can use the UPDATE statement with the following syntax to do…
Often in PostgreSQL you may want to select columns based on their position. You can use the following syntax to do so: SELECT col2, col4…
Often in PostgreSQL you may want to count the number of words in a string. You can use the following syntax to do so: SELECT *,…
