1

We have a requirement where we need to store mail templates in databases. these mail templates use some images. So we are thinking about storing a folder with images and HTML file in the database. The folder will have 200-300 kb of storage and we need to store 15-20 templates.

Which column type should we use to store folder in PostgreSQL? What are the different type of datatype for folder storage and which is the best in performance?

YogeshR
  • 1,606
  • 2
  • 22
  • 43

1 Answers1

0

For storing images you can use PostgreSQL's datatype BYTEA.

For the according HTML of that mail-template you could use TEXT or BYTEA as well.

Just be aware that PG might compress really large chunks of data..

The performance for the TEXT datatype is around 15% better than the ByteA datatype as tested here..

I hope that helped ;)

iLuvLogix
  • 5,920
  • 3
  • 26
  • 43