Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yogonza524/45f5284af18a4e56656a to your computer and use it in GitHub Desktop.
Save yogonza524/45f5284af18a4e56656a to your computer and use it in GitHub Desktop.
Esta funcion devuelve TRUE si la fecha pasada como parametro es mayor a la fecha actual y FALSE en caso contrario
CREATE OR REPLACE FUNCTION compare_fecha_hoy(fecha date)
RETURNS BOOLEAN AS $$
DECLARE
BEGIN
IF (fecha > now()::date) THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;
$$
LANGUAGE PLPGSQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment