hstore如何转换成列?

时间:2019-03-03 00:00:05

标签: postgis data-cleaning hstore

我正在尝试将key => value关系拉到商店外部,以便可以对其执行以下查询:

update tags set abandoned = null 
WHERE abandoned IN 
(
SELECT abandoned FROM tags 
GROUP BY abandoned HAVING COUNT(*) < 900
);

是否可以在hstore中运行此查询?

如果没有,如何正确将值从hstore移到新列?我尝试了以下方法,但是已经超过7000s,所以我认为它不起作用

update tags set 
abandoned = (b.tags -> 'abandoned')
FROM tags as b 
WHERE tags.id = b.id

update tags set 
tags = (b.tags::hstore - 'abandoned'::text)
FROM tags as b 
WHERE tags.id = b.id

0 个答案:

没有答案