FILE - In this Tuesday, Dec. 8, 2015 file photo the likeness of a whale adorns a door at the New Bedford Whaling Museum in New Bedford, Mass. The museum has compiled a digital archive of more than a hundred thousand names of men who embarked on whaling voyages out of the Massachusetts port before the final one in 1927. (AP Photo/Stephan Savoia, File)

BOSTON | A digital list of the tens of thousands of men who embarked on whaling voyages out of New Bedford, from 10-year-old boys to a 70-year-old sailor who drank himself to death in South Africa, is a valuable resource for anyone researching their family’s seafaring past. Just be warned: You might not like what you find.

One man who found an ancestor’s name in the database went to the ship’s logbook for more information and got quite a shock, said Mark Procknik, the librarian at the New Bedford Whaling Museum, which compiled the list of more than 127,000 men who set sail on whaler ships from 1809 until 1927.

When the ship made a stop at Pitcairn Island in the South Pacific, someone sabotaged the vessel by boring holes in the hull. It turns out the villain was an ancestor.

“They threw him in irons, and when the ship reached Peru, they threw him off,” Procknik said.

Some people who for years have heard stories about an ancestor who was a captain on a whaling vessel have searched the database only to find out that their forebear was a greenhand, the lowest rank on board, said Judith Lund, a historian and author who led a platoon of volunteers in compiling the database.

The searchable list includes the sailor’s name, age, job title, home state or country, and in some cases notes physical characteristics, including skin and hair color. It lists men from 33 states, two U.S. territories and more than 100 foreign nations.

It illustrates what Herman Melville so eloquently described in “Moby-Dick” of a city teeming with the strangest characters from all corners of the globe.

Melville writes of “the Feegeeans, Tongatobooarrs, Erromanggoans, Pannangians, and Brighggians,” and “the wild specimens of the whaling-craft which unheeded reel about the streets.”

“Imagine coming to this little town in the middle of the 19th century and seeing all these strange people,” Lund said.

Sometimes the list contains tidbits of information that shed more light on the life — or death — of a sailor.

Charles Harmond, of Wareham, was 10 years old when joined the crew of the George Washington in 1832. H. Carleston, of New Bedford, was 70 when he embarked on the Charles W. Morgan in 1908. He never made it home. “Died at Durban after becoming intoxicated,” the records note.

Some crewmen are listed under a single name, such as Chevelor, who joined the crew of the Java in 1841 and deserted the following year at Sandwich Island — what we now call Hawaii.

And yes, Melville is in the database, although the information is scant. All the records show is that he set sail on the Acushnet in 1841 as a greenhand.

The archive, also valuable to genealogists, anthropologists and sociologists, is actually a combination of a project that began years ago at the New Bedford Free Public Library and a more recent museum project, said Michael Lapides, the museum’s director of digital initiatives.

It’s based on handwritten customs documents that were in turn copied by the chaplains of the New Bedford Port Society. The original records were written by customs officers who may not have been accomplished spellers and who got the information from seamen who may not have been certain of how to spell their own names.

Therefore, the way a family spells their name today may not be how it is spelled in the database. In fact, a single sailor’s name may have been spelled different ways if he went on multiple voyages.

The information was kept because the men often never returned, Procknik said.

“There were deaths on every voyage, and desertion was rampant,” he said, noting that even Melville deserted.