如何删除行名称中带有“。”的行

时间:2019-10-20 12:36:02

标签: postgresql

我有这张桌子:

 id |            key            |                value                 
----+---------------------------+--------------------------------------
  1 | insight.enabled           | true
  3 | customer_id               | 2720f38b-c999-4f29-ba32-4da851c58d06
  4 | eula_accepted             | true
  5 | insight.mandatory_confirm | true
  6 | automation.enabled        | true
  7 | automation.enabled        | false
  8 | automation.enabled        | false

当我执行以下命令时,我想删除Automation.enabled row:

delete from configuration where automation.enabled='false';

我收到以下错误消息:

ERROR:  missing FROM-clause entry for table "automation"
LINE 1: delete from configuration where automation.enabled='false';

我如何转义'。作为列名的一部分?

1 个答案:

答案 0 :(得分:0)

条件需要一列。 automation.enabled是特定行中的值。因此,您需要的是这样:

DELETE from configuration where key = 'automation.enabled' AND value = 'false';