The function with the glorious name “find_node_by_nearest_link_within_distance” is part of pgRouting and can be found in matching.sql.
“This function finds nearest node as a source or target of the nearest link”
That means that we can use this function e.g. to find the best road network node for a given address.
The function returns an object of type link_point:
CREATE TYPE link_point AS (id integer, name varchar);
To access only the id value of the nearest node, you can use:
SELECT id(foo.x) FROM ( SELECT find_node_by_nearest_link_within_distance( 'POINT(14.111 47.911)', 0.5, 'nw_table')::link_point as x ) AS foo