SQL X-to-Y
damirsystems.comA Postgres feature I took way too long to discover: exclusion constraints, which is essentially "unique by some function of a column value" instead of "unique by a column value": https://www.postgresql.org/docs/13/ddl-constraints.html#DDL-...
You, probably like myself, took way too long to discover them because they have a fairly niche usage and are probably Postgres' least appropriately documented feature. It makes it hard to imagine the ways that it can be used. We should probably do something about that.
I read the second description in the manual and amazed it exists. I can totally see use cases where you want "almost unique" constraints (same name, date of birth too close??)
Why do I have to complete a captcha to access this website?
You don't. Just close the site! I was curious but not that curious...
(edit: it's archived: http://archive.is/H9EYE )
They even dare to tell you to turn off ad blocking to get through the Cloudflare captcha. So much for "making the internet faster"...
In addition, I find the new hCaptcha used by Cloudflare much worse than reCAPTCHA. It's slower, with ambiguous inputs demanding more mental effort, and sometimes it just refuses my correct answers.
Google probably has a good enough handle on you to serve the easy captchas. But keep in mind that for users they can't fingerprint (e.g. with Tor Browser), reCAPTCHA is usually insanely hard or even blocked ("Your computer or network may be sending automated queries"). hCaptcha has been heavenly compared to that.
'Hard' is not quite the right word for it. reCAPTCHA frequently rejects objectively correct responses when they fail to fingerprint you.
I've seen some sites suggest they CAPTCHAs will go away if I disable my ad blocker[†], so if not everyone is getting it this could be a factor. Before I bother even clicking to see if I get the CAPTCHA, is the content worth the effort?
[†] I can see how this replaces ad revenue at all, so I assume it is an attempt to make running an ad blocker seem like an inconvenience rather than a benefit.
I still got the captcha even though I'm running no adblocker
Sorry, firewall thing -- dependent on recent (geo-ip) threats. Nothing to do with ads -- no ads.
Turn it off.
What threat to you are bots viewing your website?
Same here, today I figured out I'm not human...
I find the notation compact but confusing. Are Thing and Category essentially tables? What does `thing {T, C}` mean, if T already means Thing?
A thing is uniquely identified by T, category by C.
May read it as: CREATE TABLE thing (T_ID integer, C_ID integer)
Is there further discussion of the "Alternate Key" somewhere? This is a new term to me. Is it like a candidate key?
In general there can be more than one candidate key for a given relation (table). Only one candidate key is "primary", all others are "alternate".
Thanks that makes sense.
Is this an industry term or are you just using it here to emphasize the difference?
I've seen alternate used in other places to refer to candidate keys that are not currently the primary key, though I'm fairly sure it isn't a defined standard term.
Industry term. But it is usually unknown to people who tend to use id as primary key for every table.
Do you mean synthetic keys rather than natural keys?
Yes, it is exactly a candidate key as they describe it - simply another field which uniquely identifies rows in the entity.
EDIT: Agree with panda17, they're using it as "candidate keys which were not chosen as primary key."
SQL Assertions are incidentally the most requested feature for the Oracle database: https://community.oracle.com/tech/apps-infra/discussion/4390...
/me mumbles something about the BOOLEAN data type.
What is AK? I know PK and FK but AK has escaped me... at least the acronym...
Basically, every time you use UNIQUE in a column or set of columns that is not a PK, it is an AK (Alternate Key).