Re: WIP: extensible enums - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WIP: extensible enums
Date
Msg-id 15783.1287948822@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP: extensible enums  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: WIP: extensible enums
List pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> The point with an OID array is that you wouldn't need to store the
> enumsortorder values at all. The sort order would just be the index of
> the OID in the array. So the comparison code would read the OID array,
> traverse it building an array of enum_sort structs {oid, idx}, sort
> that by OID and cache it.

Hmm.  But I guess we'd have to keep that array in the pg_type row,
and it'd be a huge PITA to work with at the SQL level.  For instance,
psql and pg_dump can easily be adapted to use enumsortorder instead
of pg_enum.oid when they want to read out the labels in sorted order.
Doing the same with an array representation would be a very different
and much uglier query.  I'm not eager to contort the catalog
representation that much.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: WIP: extensible enums
Next
From: Peter Eisentraut
Date:
Subject: typenameTypeId refactoring