George, I think your premises are a little confused. You say you want to build a "WMS file", but WMS isn't a file. WMS stands for "Web Map Service", which is any program that conforms to the WMS Specification.
There are two pieces to the WMS: a client, and a server. The client requests images according to the specification, while the server sends the images according to the specification. OpenLayers will work as the client. They have already handled most of the logic that you will need to read from a WMS server. You will need to set up a WMS layer to make it work. The other thing you need, then, is a WMS server.
I am assuming you don't actually want to build a WMS server, because AFAIK there are free ones that will do (almost) anything you need. That means you'll want to use a map renderer that can be run as a WMS server.
Map renderers turn geometric data into images. They will turn your shapefile or postgis table (or other data source) into a jpg, or a png, or another supported image format. As capdragon said, the three most popular ones are MapServer, GeoServer, and ArcGIS Server. ArcGIS server is not free; GeoServer and MapServer are.
MapServer and GeoServer can both read tables out of a PostGIS database. This means that when you update the table, your map will update as well.
Because you have limited experience with GIS, I would recommend using GeoServer. I find it to be a little bit more user-friendly than MapServer. (I tend to trust MapServer more because it is run as a CGI, which means it starts up again every time you request an image. That makes it so you never have to restart it, and means you won't suffer as much from memory leaks in the program. There is a performance cost with CGI, though, because it has to spin up a new process every time you request an map image.)
To recap, your game plan is:
- Pick MapServer, GeoServer, or ArcServer.
- Read the directions/ask questions until you figure out how to it up as a WMS.
- Make OpenLayers talk to your newly established WMS server.