-- -- person__last_name/1 -- create or replace function person__last_name( integer ) returns varchar as $$ declare last_name__person_id alias for $1; begin return last_name from persons where person_id = last_name__person_id; end;$$ language plpgsql;