I'm going to deploy my application on Heroku, for this purpose I created a database there. As Hibernate's option hibernate.hbm2ddl.auto=create
didn't work I wrote a SQL queries manually. Everything went good until I tried to insert a BLOB to the database.
I have a table photo
:
CREATE TABLE photo (
id SERIAL PRIMARY KEY,
content BYTEA
);
and I'm doing such insertion query:
INSERT INTO photo (content) VALUES (pg_read_file('./files/images/01_Tomato-Soup.jpg')::BYTEA);
After this step I get an error:
[2016-07-15 18:57:01] [42501] ERROR: must be superuser to read files
Inserting of other entities also fails as they have a foreign key to photo
table.
What is this error about, is it possible to insert BLOBs in Heroku database not being a superuser?