22.10. Retrieving Values from MAP Data (map_values) #
This stored procedure must be executed inside a duckdb.query() call as Postgres Pro AXE does not support the MAP data type.
Required privileges: Postgres Pro AXE administrator only. For a full list of stored procedures and privileges, refer to Section 12.1.
Execute the following command on the Postgres Pro AXE server:
SELECT * FROM duckdb.query('SELECT map_values(MAP)') ON CONFLICT DO NOTHING;
Where MAP is the MAP data from which values must be retrieved.
You can specify a column with the MAP data type or a MAP literal.
Postgres Pro AXE returns a list of values from the MAP data.
Example 22.10. Executing the map_values Stored Procedure
MAP data in the data column of the map_table table:
id | data
----+-------------------------
1 | {'a': 1, 'b': 2, 'c': 3}
SELECT * FROM duckdb.query('SELECT map_values(data) FROM map_table') ON CONFLICT DO NOTHING;
[1, 2, 3]