I have run a code in pgAdmin it returns 43 rows of data. I took the same code ran it in QGIS and found the same row of data. However while trying to add the new data into the map QGIS comes with the error
WARNING Invalid PostgreSQL layer
I ran two forms of this code and both came back with the same error.
SELECT pin, ST_MakeValid(parcels.geom), ST_MakeValid(address_points.geom)
FROM parcels
JOIN address_points
ON ST_Contains(parcels.geom,address_points.geom)
WHERE class = 'CLUB';
or
SELECT pin
FROM parcels
JOIN address_points
ON ST_Contains(ST_MakeValid(parcels.geom), ST_MakeValid(address_points.geom))
WHERE class = 'CLUB';
What I am trying to do is select all the parcel that contains club within, and will add the new data to a new table (create table AS ....). I was making the map first to see if the data was good to map, which lead to the above error.