我有以下表定义:
CREATE TYPE product_limit_type AS (
product_code varchar(5),
limit_type varchar(30),
limit_value numeric(4,0)
);
CREATE TABLE rule_locks (
session_id bigint,
rule_id bigint,
product_limit product_limit_type
);
当我执行以下查询时:
DELETE FROM rule_locks
WHERE (session_id=session_id_ AND product_limit.product_code=product_code_);
我从服务器收到此错误:
ERROR: missing FROM-clause entry for table "product_limit"
LINE 1: ...FROM rule_locks WHERE (session_id=session_id_ AND product_li...
^
session_id_
并且product_code_
是相应类型的预初始化变量。
它应该如何擦除/修改一行,其单元成员变量满足给定条件?