Export all pixel data from subset

I currently have 58 subsets of S2A products and wish to export all the pixel data to a .txt file to enable me to import this data intyo a postgres table before reading it into my python analytical scripts.
At the moment i have to create a ‘geometry’, draw a rectangle encompassing the entire subset, and then ‘export mask pixels’.
then do this again for every subset.
I have tried to ‘transfer selected mask to other products’, but this never works.
I can get the values for each pixel as a .csv file, but this doesnt have the pixel location information i get when using ‘export mask pixels’
is it possible to have this process built into the graph builder for batch processing please!

Have you tried with StatisticsOp in GPT? Maybe it is worth exploring: