A
A
Alexander Avtomonov2014-06-04 15:44:26
PostgreSQL
Alexander Avtomonov, 2014-06-04 15:44:26

How is sorting and indexing by enum field done in PostgreSQL?

How will Postgres sort by an ENUM field? By text label or by internal numeric representation (enumsortorder) ?
Is it possible to make a selection on an ENUM-type field using just enumsortorder, that is, not WHERE type = 'Type 1', where Type 1 is the text label of the ENUM-type value, WHERE type = 1, where 1 is the enumsortorder for a specific label?
And accordingly to build Btree on the ENUM field?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimitriy, 2014-06-04
@avtomon

1. By enumsortorder
2. Not directly, or own function/operator/join/...etc.
3. Can

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question