←back to thread

366 points virtualwhys | 3 comments | | HN request time: 0.588s | source
Show context
srcreigh ◴[] No.41900307[source]
It’s really annoying to see people write that Postgres has a “primary index” and “secondary indexes”. No. That’s not what those words mean. Every index in Postgres is a secondary index.
replies(1): >>41903808 #
sgarland ◴[] No.41903808[source]
You’re not technically wrong, but even Postgres’ docs [0] use the term Primary Key.

[0]: https://www.postgresql.org/docs/current/ddl-constraints.html

replies(1): >>41904432 #
srcreigh ◴[] No.41904432[source]
Postgres primary key indexes are not primary indexes.
replies(1): >>41905138 #
1. sgarland ◴[] No.41905138[source]
I know that, I’m saying that it’s a fairly pedantic argument when even their own docs use the term loosely.
replies(2): >>41906024 #>>41909511 #
2. j16sdiz ◴[] No.41906024[source]
"Primary Key" is the term in SQL standard. The url you linked is in "Part II: The SQL Language"
3. jeltz ◴[] No.41909511[source]
Primary keys are primary indexes are two mostly unrelated terms.