I would love to store some html in a column in pos...
# sql
m
I would love to store some html in a column in postgresql, but I've found that the XML datatype (https://www.postgresql.org/docs/current/datatype-xml.html) is too strict to parse bad html. I've tried a python based stored procedure that uses BeautifulSoup, but it felt too ugly for production. Anyone have experience with this sort of thing? Is there a way to relax the xml parser in postgresql?
s
Just use
text
and store it as a string as its just string. You do the parsing when you retrieve it from the database.
m
I'm looking to develop an api similar to the following:
select xpath((mypage::html), '//a/text()') from crawler.output