Search Postgresql Archives

Sorting composite types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there any way to define a natural sorting order for composite types? For example, let's say you have a type like:

CREATE TYPE contrived AS (
    i1 integer,
    i2 integer
);

The semantics of this contrived type are that the natural order is ascending NULLS first for i1 and descending NULLS last for i2. I know I can do an ORDER BY per query and specify each part separately, but if my contrived example has a perceived natural sort order, is there any way to set that in a global way so that I can simply and universally ORDER BY my_contrived_column?


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux