PostgresSQL v12.5
There is a table with single column containing strings formatted as XML.
create table XMLDATA (value text);
--------
text
--------
<something> <a>uyt</a> <b>xyz</b> </something>
<something> <a>ryu</a> <b>sdg</b> </something>
For simplicity let's claim that there are no nesting: all tags inside <something> contain primitive values (strings).
Assuming that there are much more elements than <a> and <b> inside, it would be great to have an option to convert these values into a relational form without enumerating all of the nested tags manually.
Was trying to get something in documentation related to XPATH, XMLTABLE, XPATH_TABLE, but there are small number of examples that did not help me to reveal the full power of these functions.
What I am looking for is a function special_function with results like
select * from special_function(XMLDATA);
a | b
-----------
uyt | xyz
ryu | sdg
Could you help me find a functionality of PostgreSQL that automatically recognizes XML tags and convert their content into columns?