In relation to my other post Date filter up to current point in time
I have created simple
CURRENT_TIMESTAMP dimension and gave it some timeframes.
When I use YEAR the SQL behind it writes:
DATE_PART('year', <field>) but that will not be valid for timestamp, should be using
EXTRACT(YEAR FROM <field>) instead, don’t you think?
Otherwise following error will be returned:
Invalid operation: function pg_catalog.pgdate_part("unknown", timestamp with time zone) does not exist;
same happens with
hour of day . I believe there needs to be a bit more thought into when to choose
DATE_PART and when
This could be specific to Redshift (still looking for more information) but that’s why EXTRACT is usually safer option
I solved it by casting
CURRENT_TIMESTAMP::TIMESTAMP explicitly thought I think it’s bonkers