【问题标题】:Update bytea data with NULL in postgresql在 postgresql 中使用 NULL 更新 bytea 数据
【发布时间】:2013-03-07 20:46:44
【问题描述】:

我有一个 bytea 字段,其中包含我想用 NULL 替换的数据。我尝试了以下语法:

update ir_act_report_xml set report_rml_content_data = E'\\000'::bytea, report_sxw_content_data = E'\\000'::bytea where id = 365;

但它随后返回 00 而不是 NULL。

将 bytea 字段更新为 NULL 的正确语法是什么?

【问题讨论】:

    标签: postgresql-9.2


    【解决方案1】:

    只需使用关键字NULL

    UPDATE ir_act_report_xml SET
       report_rml_content_data = NULL,
       report_sxw_content_data = NULL
     WHERE id = 365;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-08
      • 1970-01-01
      • 2016-08-18
      • 2017-06-26
      • 1970-01-01
      • 1970-01-01
      • 2013-12-14
      相关资源
      最近更新 更多