I have looked into Database schema documentation for the public data dump and SEDE.
But there is no explanation about the postlinks
table. Can anyone explain me the meaning of each column of that table?
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.
Sign up to join this communityI have looked into Database schema documentation for the public data dump and SEDE.
But there is no explanation about the postlinks
table. Can anyone explain me the meaning of each column of that table?
The table lists all 'linked' and 'duplicate' links related to a post.
You can use it to query what posts are linked as a duplicate for example.
Schema explanation:
Id
- primary keyCreationDate
- when the link was createdPostId
- id of source postRelatedPostId
- id of target postLinkTypeId
- type of link (currently either 1, linked, or 3, dupe)Linked post are any internal link referenced in the question or in answers or comments below a question. Duplicate links are created when the source post has been closed as a duplicate.
Quoting from the schema, the LinkTypeId
values are:
- 1 = Linked (
PostId
contains a link toRelatedPostId
)- 3 = Duplicate (
PostId
is a duplicate ofRelatedPostId
)
The PostId
column only ever refers to questions; the vast majority of RelatedPostId
targets are questions too, with about 1000 exceptions (which are answers); it is unclear when the site will insert an answer link instead of a question, but all these exceptions are 'linked' links, not duplicates.