I have following composite type in postgreSQL:
Composite type "public.type_data"
Column | Type | Modifiers
-------------+---------+-----------
series_id | text |
data_date | date |
data_value | numeric |
data_source | text |
that I use to pass as argument VARIADIC input_array type_data[] to a function in postgreSQL. I also have the following list in python:
list = [['BRLUSD', '2021-02-26', 5.5302, 'gen'], ['BRLUSD', '2021-02-25', 5.46, 'gen']]
that I want to pass as argument to my function. I use query = cur.mogrify("SELECT * FROM data_update(%s::type_data);", (list)) to get the query string but it returns the following error:
query = cur.mogrify("SELECT * FROM data_update(%s::type_data);", (list) )
TypeError: not all arguments converted during string formatting
What am I missing. Is there a better way to pass a list as an array argument for a postgreSQL function?