Postgres / hstore:如何获取 hstore 字段中具有特定键的行的 ID?

Postgres / hstore : how to get IDs of rows with certain key in their hstore field?

我正在查询 pgsql 数据库以查找在 hstore 字段中具有特定键的行:

select DISTINCT
from (select id, exist(data, ‘exercise_quiz’) key_exists
  from user_tracking) x
where key_exists = true;

它工作正常,但我需要打印相应行的 ID returns。我可以使用此命令执行此操作吗?

使用运算符hstore ? text (does hstore contain key?):

select id
from user_tracking
where data ? 'exercise_quiz';