Hello all. I am new to PostgreSQL and trying to write my first function. I followed the samples in documentation and I wrote the function below:
CREATE OR REPLACE FUNCTION TEST() RETURNS TABLE (today DATE) AS'
DECLARE today DATE;
today = current_date;
select * from TEST();
Instead of "today=current_date" I also tried "select current_date into today", and several other things. Here, I expect to see a table with a column containing today's date. But I see an empty table. Could you please tell me what I am doing wrong? Thanks.