Fixed #23514 -- Prevented queries in PostGISOperations init

Thanks Mattia Procopio for the report.
Stylistically, I prefer "#17656 - DatabaseOperations initialization shouldn't query the database." (of course tests are meant to test things so starting every docstring with "Test ..." seems redundant. Otherwise the code looks good.