我有一个带有模式的表,该表有一个json字段。该文件已经填充了大量数据。
CREATE TABLE table(
id UUID NOT NULL
data JSON NOT NULL
);我想为json字段创建一个索引。我试过下面的脚本
__table_args__ = (
Index("index_table_on_data_gin",
"data",
postgresql_using='gin',),
),
Index("index_table_on_id_gin",
"id",
postgresql_using='gin',),
),
)这是我正在犯的错误。
JSON索引创建错误
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) data type json has no default operator class for access method "gin"UUID索引创建错误
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) data type uuid has no default operator class for access method "gin"https://stackoverflow.com/questions/71337447
复制相似问题