Hey there is there a way to format date column to ...
# help
m
Hey there is there a way to format date column to 'dd.mm.yyyy' and filter it using LIKE operator ?
k
probably, but why would you do that?
m
cause i need to filter record by date in application
eg. users types 8.
app should show all records where day is 08
or 18.1.20
shows all records where day is 18 month is 1 and years starts with 20
but dates are stored in different format and i cant use LIKE because they are not text
k
That's an interesting requirement, but sure - you can add a generated column to your table and filter on that
m
could you send me something where i can get to know more about this generated column and filtering ?
k
You can either use a function with a PostgREST Computed Columns: https://postgrest.org/en/stable/api.html#computed-columns Or use PostgreSQL's Generated Columns: https://www.postgresql.org/docs/14/ddl-generated-columns.html
the first one is computed on demand, the second is stored in your table