I am trying to import contents of a file locally stored into a column of a row in a table. The type of column is bytea.
Something like:
UPDATE server_info
SET key = lo_import('C:\Users\certificate.p12')
WHERE server_id = 1;
However, it gives below error:
ERROR: column "key" is of type bytea but expression is of type oid
I tried casting. Used below line for it:
UPDATE server_info
SET key = lo_import('C:\Users\certificate.p12')::bytea
WHERE server_id = 1;
But it gives:
ERROR: cannot cast type oid to bytea
I am new to using Postgres. Any leads in this matter will be helpful. Thank you