A 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-...
SQL X-to-Y
21–30 of 30 posts
Re: SQL X-to-Y
#22Why 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 )
Re: SQL X-to-Y
#23Re: SQL X-to-Y
#24Is 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".
Is this an industry term or are you just using it here to emphasize the difference?
Re: SQL X-to-Y
#25A 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.
Re: SQL X-to-Y
#26Re: SQL X-to-Y
#27Earlier quoted context omitted.
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?
Re: SQL X-to-Y
#28Earlier quoted context omitted.
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?
Re: SQL X-to-Y
#29What is AK? I know PK and FK but AK has escaped me... at least the acronym...
Re: SQL X-to-Y
#30Earlier quoted context omitted.
Thanks that makes sense. Is this an industry term or are you just using it here to emphasize the difference?
Industry term. But it is usually unknown to people who tend to use id as primary key for every table.