I am using a Postgresql database in my rails application. To store large file or data in database I have used blob data type in MySql.
For Postgres which data type I
I think this is the most comprehensive answer on the PostgreSQL wiki itself: https://wiki.postgresql.org/wiki/BinaryFilesInDB
Read the part with the title 'What is the best way to store the files in the Database?'