I am new to QGIS. I am trying to connect a view from PostGIS to QGIS (3.16.4, same with 3.12). The PostGIS connection in QGIS browser have no issues and when "Test Connection" it says it can connect.
But when I am trying to add the layer I am getting this error:
Layer is not valid: The layer dbname='dwa' host=localhost port=40802 user='user' password='user' key='"bin"' srid=4326 type=Polygon table="public"."height_grid_layer_view" (bin) is not a valid layer and can not be added to the map. Reason:
The pgAdmin 4 shows the view in Geometry Viewer without any problem with the SQL:
SELECT * FROM public.height_grid_layer_view
What can I do?
\d public.height_grid_layer_viewin the psql console (not in pgadmin)?