Is it appropriate to put a comma before "which"?

On Server Fault, we were discussing this question in chat. There are non-native speakers in the chat and somehow we got on the topic of grammar and proper use of commas.

The sentence of interest:

I have just got a new Ubuntu LAMP VPS server, which I am trying to configure.

Some people thought that the comma was superfluous. Others did not.

When is it appropriate for a comma to preceed the word which, and is the example sentence above correct?


Also, before you vote to close this question as a dupe of this, please consider the differences between the two questions and ignore the similarity of the titles. The OP's example sentence was restructured in that question instead of addressing the proper use of commas.


Solution 1:

Supplementary (or non-defining, or non-restrictive) relative clauses are by convention set off by commas and integrated (or defining, or restrictive) relative clauses are not. The clause in the example, 'which I am trying to configure', is a supplementary relative clause, so the comma is appropriate.

You can generally distinguish a supplementary relative clause from an integrated one by seeing whether or not you can detach the relative clause and still be left with a meaningful sentence. With the example, you can say simply 'I have just got a new Ubuntu LAMP VPS server' without the clause 'which I am trying to configure', which is a piece of bonus information. However, if the example had been 'I'm not getting anywhere with that new Ubuntu LAMP VPS server which I am trying to configure' the relative clause is essential in identifying exactly which new Ubuntu LAMP VPS server is being discussed. 'I'm not getting anywhere with that new Ubuntu LAMP VPS server' on its own doesn't tell us.

Solution 2:

Follow this rule:

  • If the 'which clause' is a defining clause, then no comma is required.
  • If the 'which clause' is not a defining clause, then the comma is required.

In the OP's sentence, the 'which clause' is non-defining so the comma is needed.

Here are some examples of defining 'which clauses':

  • The computer which I bought yesterday has broken down already.
  • Do you have the screwdriver which you borrowed last week?

Another way to think of a defining 'which clause' such as those above is that it identifies its antecedent.

  • Which computer has broken down? - the computer which I bought yesterday?
  • Which screwdriver are you talking about? - the one which you borrowed last week

Non-defining 'which clauses', on the other hand, do not identify the antecedent but give extra information about it:

  • My new computer, which I bought on Amazon, has broken down already.
  • My favourite screwdriver, which is a Philips, has gone missing.
  • I have just got a new Ubuntu LAMP VPS server, which I am trying to configure.

Solution 3:

You put a comma before which when there is only one new Ubuntu LAMP VPS server. If there is more than one, then the comma isn't used.

The logic behind this is that it all depends whether you need to differentiate the object you are talking about from another one with common traits. If you do, then the comma isn't used. In this case you can replace which with that. The information which follows which/that is necessary for the reader to understand which new Ubuntu LAMP VPS server you are talking about. If, however, there is no need to distinguish the servers because there is only one, you use comma before which and that can't be used in its place.