User avatar
Jeder neocat_floof_googly_woozy neocat_flag_agender 🔜 eth0 @jeder@miau.jeder.pl
2y
anyway
how the fuck do you get a root domain from a string in sql
4
0
0
0

User avatar
猫猫 verifiedsabakan antifa disability_flag @puniko@mk.absturztau.be
2y
@jeder regexp magic maybe?
1
0
0
0
User avatar
Jeder neocat_floof_googly_woozy neocat_flag_agender 🔜 eth0 @jeder@miau.jeder.pl
2y
@puniko i am useless at that
1
0
1
0
User avatar
Jeder neocat_floof_googly_woozy neocat_flag_agender 🔜 eth0 @jeder@miau.jeder.pl
2y
@puniko I'd expect something more akin to, idk, a .split() or some shit
1
0
0
0
User avatar
猫猫 verifiedsabakan antifa disability_flag @puniko@mk.absturztau.be
2y
@jeder well then split_part might be what you are looking for. you can pass a negative index to it, so it goes from the end of the string
split_part ( string text, delimiter text, n integer ) → text
www.postgresql.org/docs/16/functions-string.html
1
0
0
0
User avatar
Jeder neocat_floof_googly_woozy neocat_flag_agender 🔜 eth0 @jeder@miau.jeder.pl
2y
@puniko i definitely have like
a what I'd need to do because I just got reminded of existence of co.uk

but yeah
my sql is Bad
:neocat_googly_woozy@mk.absturztau.be:1
1
0
0
1
User avatar
猫猫 verifiedsabakan antifa disability_flag @puniko@mk.absturztau.be
2y
@jeder ye, domains be mess as well
0
0
0
0
User avatar
-> @kopper@wetdry.world @kopper@brain.d.on-t.work
2y
@jeder that's... and extremely difficult thing to do just in general
2
0
0
0
User avatar
-> @kopper@wetdry.world @kopper@brain.d.on-t.work
2y
@jeder what you can try is to

1. download the
publicsuffix.org, which is as close as you can get to a list of TLDs you can register domains on
2. remove them from the end
3. split by dots and pick the last one
4. re-add the suffix you removed at step 2

good luck translating that to sql
1
0
0
0
User avatar
Mae @Mae@is.badat.dev
2y
@kopper @jeder you can also say that it's not a part of the spec and therefore not your problem
1
0
1
0
User avatar
Mae @Mae@is.badat.dev
2y
@kopper @jeder in that case ig you just split by dot, get the last two and join?
0
0
0
0
User avatar
Jeder neocat_floof_googly_woozy neocat_flag_agender 🔜 eth0 @jeder@miau.jeder.pl
2y
@kopper annoying
0
0
1
0