gpt4 book ai didi

sql - 无法更新或删除表中的行 (Postgres)

转载 作者:行者123 更新时间:2023-11-29 13:22:51 25 4
gpt4 key购买 nike

我有一个包含 bytea 字段的表。当我尝试从此表中删除一行时,出现这样的错误:

[42704] ERROR: large object 0 does not exist

在这种情况下你能帮我吗?

编辑。来自命令 \d photo 的信息:

    Table "public.photo"
Column | Type | Modifiers
------------+------------------------+-----------
id | character varying(255) | not null
ldap_name | character varying(255) | not null
file_name | character varying(255) | not null
image_data | bytea |
Indexes:
"pk_photo" PRIMARY KEY, btree (id)
"photo_file_name_key" UNIQUE CONSTRAINT, btree (file_name)
"photo_ldap_name" btree (ldap_name)
Triggers:
remove_unused_large_objects BEFORE DELETE OR UPDATE ON photo FOR EACH ROW EXECUTE PROCEDURE lo_manage('image_data')

最佳答案

放下触发器:

drop trigger remove_unused_large_objects on photo;

关于sql - 无法更新或删除表中的行 (Postgres),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38717863/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com