Function to determine German holidays in PostgreSQL-12
Background Big data must be enriched with other information so that observations and behavior can be analyzed exaltly. This also includes holidays because they have a strong influence on people’s behavior. So that the holidays do not have to be researched manually for each year, it is advisable to convert the logic behind the (German) holidays into a plpgsql function (see below – tested with PostgreSQL 12).
PSQL-Function Holidays that are not defined by an exact date are dependent on Easter. The lower function returns the date for Easter Sunday for the desired year.