Hi David
Roots Ireland (www.rootsireland.ie) have 2 Patrick Flannery civil birth/baptism records for a child Patrick born to a father John Flannery in Co. Mayo. If one or probably 2 of these records refer to your Patrick, particularly the civil birth record, it should include his mother's name and more importantly a townland in Charlestown. Unfortunately there are over 60 records of a John Flannery marriage but you could probably play around with the dates, eg if John was born circa 1847 he was probably aged between 25-45 when he married and if the Patrick birth record is accurate you can get his mother's pre-mariage name from it and lessen the time/money spent looking for a marriage through those 60-something on the list. Have a look if you get a chance it may lead to something
Good luck
Mrs Doyle