I have been using PostGIS 3.0. The ST_HausdorffDistance() function calculates a symmetric distance between two polygons. However, Hausdorff distance is not a metric since it is the maximum distance between the closest pairs of vertices. Therefore, it depends on the number of vertices each polygon possess. I could not understand how PostGIS made it symmetric.
In addition, when I investigated a toy dataset, where we have two polygon layers (A and B), and their corresponding vertices generated by the Coord. AttribuTable plugin of QGIS (A_vertices, B_vertices), I calculated the Hausdorff distance from A to B as 16.41 and 18.13 for polygons with IDs 111 and 222 respectively. These distances are 31.19 and 25.70 in PostGIS.
select ST_HausdorffDistance(a.geom, b.geom)
from a, b
where a.id=222 and b.id=222