1

Up to now I use the Character Type "text" to store HTML in PostgreSQL.

I would like to make it more obvious to new users who look at the database schema, that this column contains HTML and not text.

How could I make this more obvious?

PS: I don't want PG to look into the HTML and validate it or quote it. This is just about users looking at the column specification and understanding "aha, this is html, not text".

1 Answer 1

5

Postgres actually does have an XML type, but as HTML is not exactly XML, it may not make sense to use the XML type to store your content.

I suggest just putting the text html into the column name, e.g. something like html_content. This way, it will be very visible to anyone perusing the table about what is contained within this column.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.