I'm using Quantum GIS and Postgres with the GIS extensions to store shapefiles that I'd like to run point in geometry and point in union geometries against. While it's easy to save and load the vector layers to the database, I'm having problems figuring out how I can run operations against them. How do I use the database to SELECT WHERE lat/long values in another table are contained with a saved polygon geometry? How do I union a couple of geometries and use that in the WHERE clause? I'm having a lot of trouble figuring out what the schema of the saved polygons actually is.
Edit: The shapes have a number of holes in them, if it matters for performing the selects and the unions.