0

I got an error from PostgreSQL (11) when my code tries to CREATE INDEX on a view:

ERROR:  "_blk_l" is not a table or materialized view

To avoid the error, I wanted to check if a regclass object can be indexed before creating the index. Looking in the documentation, there are the following types of objects:

relkind

r = ordinary table, i = index, S = sequence, t = TOAST table, v = view, m = materialized view, c = composite type, f = foreign table, p = partitioned table, I = partitioned index

I guess r and m can be indexed. Are there other types of objects that can be indexed in above?

0

As far as i know only tables/relations, partitioned tables and materialized views are indexable because they are persisted in disk, i cant think in use of case of indexing a sequence, indexing an index (indexception?).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.