Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将图像blob数据存储到数据类型为bytea的postgresql列中_Sql_Postgresql - Fatal编程技术网

将图像blob数据存储到数据类型为bytea的postgresql列中

将图像blob数据存储到数据类型为bytea的postgresql列中,sql,postgresql,Sql,Postgresql,我想将图像斑点数据插入数据类型为bytea的列中 插入查询如下所示: insert into messages(message, thumbnail_blob) values('DROPBOX', '00\u0000\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u000u0014P ��(\u0000��(\u0003��') returning id 为了便于理解和格式化,我缩短了blob数据 执行上述查询后,我得到一个错误为什么不将图像保存在文件

我想将图像斑点数据插入数据类型为
bytea
的列中

插入查询如下所示:

insert into messages(message, thumbnail_blob)
values('DROPBOX', 
'00\u0000\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u000u0014P ��(\u0000��(\u0003��') 
returning id
为了便于理解和格式化,我缩短了blob数据


执行上述查询后,我得到一个错误

为什么不将图像保存在文件系统(或NFS)中并将路径存储在postgres中?你将有更小的转储…@Renato存储在应用程序中,存储数据库是不同的,我不想将文件存储在应用程序内存中。你说得对!我想的是一个网络应用程序,而不是一个应用程序@Renato,这是一个web应用程序,我所说的应用程序是指应用程序服务器内存;i、 e应用程序的RAM。好的,如你所愿,我们将它们保存在一个共享文件sistem中,但是我们有很多图像和400 GB的db没有它们。。。小分贝,小转储,快速恢复,但很可能,这不是你的需要:这只是一个建议