Mealplan: Allow ordering until 9am
As long as you have the dates in a date column, you can use a simple CASE to choose, which meal is selected.
The result if the query, depends when you look for the example, it will choose pasta before 9 in the morning a Minute later and you would get  gnocchi, you only have to enter the menus ahead of time
In an event you could delete the old menus, but that is not necessary, as you will not have millions of rows.


CREATe TABLe &quot;OrDERS&quot; (&quot;orderdate&quot; date, &quot;food&quot; varchar(40))




INSERT INTO &quot;OrDERS&quot; VALUES (CURRENT_DATE  ,'Pasta'), (CURRENT_DATE  + INTERVAL '1 day','Gnocchi')




SELECT to_char(&quot;orderdate&quot;,'Dy, Mon DD'), &quot;food&quot; FROM &quot;OrDERS&quot; 
WHERE &quot;orderdate&quot; = 
       CASE WHEN NOW() &lt; now()::date + interval '9h' THEN now()::date
            ELSE now()::date + INTERVAL '1 day'
       END


to_char     | food  
:---------- | :-----
Tue, Dec 22 | Gnocci


db&lt;&gt;fiddle here