Top "Set-returning-functions" questions

Database functions possibly returning more than one row.

PostgreSQL unnest() with element number

When I have a column with separated values, I can use the unnest() function: myTable id | elements ---+------------ 1 |ab,…

sql arrays postgresql window-functions set-returning-functions
Split column into multiple rows in Postgres

Suppose I have a table like this: subject | flag ----------------+------ this is a test | 2 subject is of type text, …

sql postgresql split set-returning-functions
PostgreSQL: ERROR: 42601: a column definition list is required for functions returning "record"

As far as I can tell, my function properly resembles the samples I've seen. Can someone clue me in as …

postgresql parameter-passing plpgsql set-returning-functions
Function to loop through and select data from multiple tables

I'm new to Postgres and have a database with multiple tables of the same structure. I need to select data …

postgresql for-loop plpgsql dynamic-sql set-returning-functions
Postgresql generate_series of months

I'm trying to generate a series in PostgreSQL with the generate_series function. I need a series of months starting …

sql postgresql time-series generate-series set-returning-functions
SQL multiple UNNEST in single select list

I was implementing a Query system. I implemented unnest function. Now user was asking about using multiple unnest in a …

sql postgresql unnest set-returning-functions
set-valued function called in context that cannot accept a set

I am receiving the error: set-valued function called in context that cannot accept a set when executing this function at …

postgresql plpgsql set-returning-functions
PostgreSQL: Flattening a relation with an array to emit one row per array entry

Given a table defined as such: CREATE TABLE test_values(name TEXT, values INTEGER[]); ...and the following values: | name | values | +…

sql arrays postgresql set-returning-functions lateral
JOIN on set returning function results

I am trying to join table and function which returns rows: SELECT p.id, p.name, f.action, f.amount …

sql postgresql join set-returning-functions lateral
Unnest multiple arrays in parallel

My last question Passing an array to stored to postgres was a bit unclear. Now, to clarify my objective: I …

arrays postgresql arraylist plpgsql set-returning-functions