Save picture in PostgreSQL

I’m new with PostgreSQL and I want to store small pictures (jpeg or png) in the database. On SQLite I could open the file with BinaryStream and save the data with blob in the database.

In PostgreSQL is something like bytea but it’s seems a little bit more complicated than in SQLite. Does someone know how to store pictures or other files in PostgreSQL?
Thank you

How large, in bytes, is your largest image to be stored?

If they are larger than 2Kb, I would opt to store them as separate large objects, store their OIDs and read them back later as necessary. Read this http://documentation.xojo.com/index.php/PostgreSQLLargeObject , and this http://documentation.xojo.com/index.php/PostgreSQLDatabase and check the example app “Example Projects/Database/PostgreSQL/LargeObjects/LargeObjects.xojo_binary_project”

I store full applications in Postgres (for remote user updating) by zip compressing them then read them in as a BinaryStream and EncodeHex() the result. Then I CONCAT it in 10 MB chunks to a TEXT field on the Postgres server with a progress bar. I assume you could do the same thing with a Picture.

See this post