Postgresql – What is the difference between CURRENT_TIMESTAMP::DATE and CURRENT_DATE?
I created an immutable function as below: CREATE OR REPLACE FUNCTION GetCurrentDate() RETURNS DATE AS $p$ BEGIN RETURN CURRENT_TIMESTAMP::DATE; END; $p$ LANGUAGE plpgsql IMMUTABLE SECURITY DEFINER; And I use this in a UNIQUE INDEX's WHERE clause like: CREATE UNIQUE INDEX…