Handy way to get used to types without needing a table or anything: #PostgreSQL:
SELECT CAST('05/21/2019' AS date) AS "test";
I've been aware of this perspective, and this way of building websites, for years (https://blog.pinboard.in/2011/03/anatomy_of_a_crushing/ but also #PostgREST and #PostGraphile) but only recently committed to leveling up #SQL sqillz, because I have a reason to use it (work).
Looks like I still have to buy a VPS to run Postgres on to use it though, which means securing it and patching it and… yeah I don't know.
@22 CAST('05/21/2019' AS date) won't work for most european installs, which use the DMY datestyle.
CAST('2019-05-21' AS date) should work for everyone (ISO-style)
@22 Worse, CAST('05/12/2019' as date) will work for both but not produce the same date (Dec,5 or May, 12) depending on the DateStyle setting
@DanielVerite yup, I was testing how smart/stupid it was :)!
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!