In postgres I have a custom function that will join first and last name.
CREATE FUNCTION full_name(u users) RETURNS varchar
LANGUAGE plpgsql VOLATILE
AS $$
BEGIN
RETURN CONCAT_WS(' ', u.first_name, u.last_name);
END;
$$;
It would be nice if I didn't have to set the the name of the column name and it was determined by the function eg.
eg. here I have to say the column name is full_name
SELECT
full_name(users) as full_name
But it would be nice if it atomically name it full_name
SELECT
full_name(users)
Is this possible to set in a custom function?