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