In the Stack Overflow data dump, I can see some posts whose ClosedDate column from the Posts table is null, but their PostHistoryTypeId = 10 (which represents post was closed) from PostHistory tables.

Is this a mistake or am I misinterpreting something?

To observe this I tried the following query on Stack Exchange Data Explorer:

select * from
SELECT Row_Number() OVER(ORDER BY q.id) As RowID, q.id,q.ClosedDate, q.DeletionDate, ph.comment
  posts q
  join posthistory ph on (q.id = ph.postid)
  ph.PostHistoryTypeId = 10
  and ph.comment between 101 and 105
  and q.CreationDate >= Convert(datetime, '2013-07-01')
  and q.ClosedDate is null
) as Rowresults

where RowID Between 0 AND 50


The ClosedDate is only set if the post is currently closed.

Assuming that a post is closed just because it has a history event for being closed is an incorrect assumption. That only means it has been closed before, but could have been reopened since then. Have you checked those posts to see if they have a Reopen post history event (PostHistoryTypeId = 11)? A reopen event would have cleared the CloseDate because it is no longer closed.


These are posts that have been closed and reopened.

  • They were closed at one time so they have an entry in the PostHistory table.
  • They are not closed now so their close date is null.

You can see this in the post timeline e.g.

and so on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .