Changes between Version 1 and Version 2 of Ticket #20888, comment 18


Ignore:
Timestamp:
Oct 15, 2016, 6:44:51 AM (8 years ago)
Author:
Tim Graham

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20888, comment 18

    v1 v2  
    11[https://github.com/django/django/pull/7398 PR]
     2
     3PostgreSQL 9.6 gets rid of most of pg_am columns[0]. In particular, amcanorder disappears and should be replaced with calls to pg_index_column_has_property(). PostgreSQL versions < 9.6 do not provide this method, hence we are forced to rely on a brittle query.
     4
     5Since only B-tree indexes support ordering[1], this is the only type of index to consider. This solution relies on the access method implementation[2] to determine whether ASC or DESC ordering is in use.
     6
     7Let's hope that a new view is added to information_schema[3] in the future.
     8
     9[0] https://www.postgresql.org/docs/9.6/static/release-9-6.html
     10[1] https://www.postgresql.org/docs/current/static/indexes-ordering.html
     11[2] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/catalog/pg_index.h;h=ee97c5dec836ad82c5b75440fcba51d4c106fc33;hb=HEAD#l99
     12[3] http://stackoverflow.com/questions/18121103/how-to-get-the-index-column-orderasc-desc-nulls-first-from-postgresql#comment64529591_18128104
Back to Top