The SQL error 42601 is a syntax error (see here). Basically, you had an extra opening parenthesis before
ST_SetSRID and also a closing missing parenthesis for the same function.
If data type of
osm_point.way column is
geometry, one needs to cast it to
geography in order to ST_DWithin evaluate to geodetic distances (instead of planar distances) and in meters (if units of spatial reference aren't already in meters). The same cast to
geography is valid for
ST_MakePoint which output is of type
geometry and the units of applied CRS 4326 is degrees, but you want meters.
So, use the following query:
WHERE ST_DWithin(way::geography, ST_SetSRID(ST_MakePoint(12.2385578688105, 51.8435615931295), 4326)::geography, 1000);
ST_DWithin one needs to compare data which have the same SRID. So, if column
osm_point.way has a different SRID (you said EPSG:3857) from EPSG:4326 (the SRID you used to define the coordinates with
ST_MakePoint), one needs to transform coordinates first. For that use ST_Transform. See:
WHERE ST_DWithin(ST_Transform(way, 4326)::geography, ST_SetSRID(ST_MakePoint(12.2385578688105, 51.8435615931295), 4326)::geography, 1000);
About using indexes to speed up your queries, as suggested by @Vince, take a look in:
Setting up indexes for PostGIS distance queries.