I would like to know how can I insert an image "bytea" into a table of my postgresql database, with the condition that the image must be a png file.
Here is the table:
"id_category" SERIAL,
"category_name" TEXT,
"category_image" bytea,
constraint id_cat_pkey primary key ("id_category"))without oids;
How can I ensure that any files inserted into the table must only be PNG files?