我想知道如何将图像"bytea"插入到postgreSql数据库的表中?我一直在搜索论坛几个小时,并且已经看过几十次同样的问题,但还没找到一个答案.我只看到如何将.jpeg插入到oid列中,这不是我需要的.
这是数据库表:
create table category (
"id_category" SERIAL,
"category_name" TEXT,
"category_image" bytea,
constraint id_cat_pkey primary key ("id_category"))without oids;
Run Code Online (Sandbox Code Playgroud)
当我添加一个新行时,它不起作用:
insert into category(category_name,category_image) values('tablette', lo_import('D:\image.jpg'));
Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的 ubuntu 18.04 上的 pgAdmin 中创建本地服务器,但出现此错误。
这是错误
这是我的设置
