I need a function for a column to change from time stamp without time zone to date: but it has to be in function form.
I have tried many many things but no luck. I am completely stuck and lost on where to even start.
I also can’t seem to figure out how to call when creating a table.
CREATE OR REPLACE FUNCTION change_data_type (recruit TEXT, recruit_date TEXT, data TEXT)
RETURNS RECRUIT AS $$
BEGIN
RETURN DATE(recruit_date) FROM recruit;
END;
$$ LANGUAGE PLPGSQL;
New contributor
dolphin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.