I have a task to pass arrays, records, and in some cases array of records as a parameter to functions in PostgreSQL.
Postgresql – Pass an array or record to a function in PostgreSQL
arraycomposite-typesfunctionspostgresqlpostgresql-9.0
Related Question
- Postgresql – pass a TABLELIKE parameter to a PostgreSQL FUNCTION/PROCEDURE
- PostgreSQL function param json_populate_recordset ARRAY problem
- Postgresql – Array exceed allowed size in Postgres
- Postgresql – Reshape array in PostgreSQL
- Postgresql – Pass array of mixed type into stored FUNCTION
- Postgresql – Is possible to insert an array inside another array in postgresql
- Postgresql – Function that loops through array parameter values to build multiple WHERE clauses (postgres 11.4)
- Postgresql: How to pass an array to trigger function in TG_ARGV
Best Answer
Postgres has very flexible handling of arrays and composite types. This may be the sort of thing you are trying to do:
dbfiddle here