Easy:
- Run unformatted code in a new new database
- Run the formatted code in a new new database
- Make a complete export of both and compare two files
They must be the same.
The reason they should be identical is because postgres parses SQL in its standard canonical form, so even adding unnecessary brackets, for example, should lead to the same internal version of the code.
source share