18

MySQL is missing DROP COLUMN IF EXISTS.

This question is asking "what the syntax for it". The official response is "there is none" (accepted answer), but there are workarounds (other answers).

I think I found a better approach that has not been proposed yet, so I wanted to post it as an answer to help other developers, but the question has been closed as off-topic.

How shall I proceed?

FYI, I basically created a reusable procedure that allows you to write call drop_column_if_exists('the_table_name', 'the_column_name');. Not revolutionary, but definitely helps.

5
  • 11
    why is that question closed as off-topic for recommend or find a book, tool, software library, tutorial or other off-site resource might be a another (better?) question...
    – rene
    Commented Apr 5, 2018 at 14:02
  • It seems to have gone through the reopen queue twice.. stackoverflow.com/posts/173814/timeline
    – Suraj Rao
    Commented Apr 5, 2018 at 14:08
  • @rene That was a dreadful closure.
    – duplode
    Commented Apr 5, 2018 at 14:20
  • 1
    @jpp I'd say msanford's advice to Sunil also applies to you. Your Meta posts are only worthy of self-deletion if you yourself truly believe that they are wrong and/or pointless. Don't let a mere majority shush you.
    – duplode
    Commented Apr 5, 2018 at 15:33
  • 4
    This question is being discussed on Meta.
    – duplode
    Commented Apr 5, 2018 at 18:48

2 Answers 2

20

duplode gave the question an edit to improve the question's shape. When I opened the question, it had gathered 2 reopen votes already. I edited the question too, and subsequently voted to reopen as well.

The question has now been reopened.

To answer your question: How shall I proceed? Well, asking a Meta question like you did appears to be a good approach. An alternative approach would be to edit the question into a better shape yourself, and see if the reviewers agree with you that it makes the question worthy of being reopened.

After having gotten the question reopened, you can add your answer.

8

(This is a respin of jpp's deleted answer, infused with my own views on the matter.)

Consider posting your solution as a self-answered question. Before you actually do that, though, carefully review the appropriateness of both your question and the existing one. There are three relevant scenarios:

  1. If your question turns out to be inappropriate (i.e. if posted in the absence of the other question, it should be closed), you obviously shouldn't post it, unless you can tweak it into something appropriate.

  2. If your question is appropriate but the preexisting question isn't (i.e. it should remain closed), that must mean there is some difference between the questions that justifies the existence of your question, so just post it. (A possible exception is if the issue that led to the closure of the preexisting question is easy to fix. In that case, see the next scenario.)

  3. If both your question and the preexisting one are appropriate, that means your question is a duplicate, and the preexisting question was wrongly closed. That being so, the ideal outcome would be getting the question reopened and then adding your answer to it. Steps for doing so include casting a reopen vote, improving the question by editing it and, if necessary, raise the issue on Meta (which, in this case, seems to have worked).

    In the (hopefully unlikely) case that, after several days, you have tried your best to get the question reopened but no progress was made and, after careful consideration accounting for the site rules and the views of your fellow users, you remain convinced that both questions are appropriate... go ahead and post your question. Yes, it will be a duplicate -- but you shouldn't be stopped from adding useful, on-topic and appropriate content due to a catch-22 borne out of a poor closing decision. To make future maintenance of the questions easier, you can use comments to explain the unusual situation and cross-link the questions. (In your comment to the preexisting question, you might even add a remark to the effect of "please ping me if this question ever gets reopened, so that I can close my question as a duplicate and move my answer here".)

As for the specific question mentioned here, it clearly fits scenario #3: the closure appears to have been a classic case of bad close votes being cast on the basis of a supposed red flag. (The red flag, in this case, being the "What is the syntax" phrasing, which was likely misread into a request for a manual.)

1
  • 1
    +1 for "Yes, it will be a duplicate -- but you shouldn't be stopped from adding useful, on-topic and appropriate content." Bottom line is do what improves SO. A well-worded question with an [mcve] + a good answer is a benefit to SO. You could spend your time looking / hoping for reopen votes / editing, but this is likely more painful and not guaranteed to succeed.
    – jpp
    Commented Apr 6, 2018 at 8:36

You must log in to answer this question.

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