PostgreSQL Hstore – How to Remove All Values of a Key

hstorepostgresql-9.3

How do I delete/remove the value of a postgresql hstore column?

I've got a table named pages and a column named settings – I need to remove the read_only value (basically, set it to empty string or nil).

Best Answer

Something like this, pages is the table, setting is the column, and key is what you are setting to null.

update pages set settings = settings || '"key"=>null'::hstore;