castorp
Joined 7 years ago
Joined 7 years ago
Since Postgres 13 installing an extension is no longer necessary as gen_random_uuid() is part of the core.
Many Postgres features aren't supported on Redshift (set returning functions, indexes, ...) and many tools that work just fine with Postgres error out because Redshift does things differently or doesn't support features that Postgres does.
Despite what the Amazon marketing is telling, Redshift is not really a "fork" of Postgres.
To my knowledge they only used the SQL parser and the wire protocol from Postgres.
The optimizer, query executor and storage engine are totally different. The whole "Redshift is Postgres" is complete marketing BS in my opinion.
Lithuania has apparently already done that.
I just turn on "Local History" in my NetBeans IDE which creates a new version of the file each time I save it. No need to use Ctrl-Z for that.
select extract(month from justify_interval(timestamp '2022-01-01' - timestamp '2021-11-01'))
returns 2It gets even strange for e.g. select DATEDIFF(year, '2021-12-01', '2022-01-01') which still returns 1 even though that's a whole month. I don't see a use case for this kind of result
Well, then you only need to compare the difference of the timestamp (or date) values with an interval of 10 days. e.g. end_time - start_time >= interval '10 days'
I don't understand the purpose of such a calculation. If you want to check if two dates (or timestamps) fall into the same year, you compare the year part of them. If you want to check how far they are apart, you compare the difference between the two to an interval.
Recursive common table expressions are part of the SQL standard (since 1999) and are quite frequently used to traverse hierarchical data (aka "adjacency list").
It is part of basically all (good) SQL tutorials - at least in the "advanced" part.