CREATE OR REPLACE FUNCTION food600.getidmiestmaster(
	idmiest integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE 
AS $BODY$
DECLARE idmiestmaster INTEGER;
BEGIN
SELECT id_miest_master INTO idmiestmaster FROM food600.miestnosti WHERE id_miest=idmiest;
RETURN btrim(idmiestmaster::character(20));
END
$BODY$;
