此查询给出错误:
create table qwe (a bigint, completed bit varying(100000));
CREATE TABLE
insert into qwe (a, completed) values (1000, repeat('0', a));
ERROR: column "a" does not exist
此查询给出错误:
create table qwe (a bigint, completed bit varying(100000));
CREATE TABLE
insert into qwe (a, completed) values (1000, repeat('0', a));
ERROR: column "a" does not exist
您可能还看到了提示:
您不能引用尚不存在的列值。
相反,请再次拼出该值。或者使用子选择或 CTE
a
只提供一次:db<>在这里摆弄
此外,您需要显式转换为
varbit
.