Point lying (counter) clockwise to Linestring check in PostGIS

Hi,

I’ve imported the OSM data using osmosis. Now I’d like to check, if a given point is on the mainland or in the sea. I thought, I’ll take the closests coastline with its bounding box containing the given point and calculate, if the point lies clockwise (=> water) or counter-clockwise (=> land) to the linestring of the coastline.
Does anyone know an algorithm which performs this check properly or even a PostGIS function so that I could do the check in the database?

Thanks in advance,
Christoph