Re: No longer possible to query catalogs for index capabilities?

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: No longer possible to query catalogs for index capabilities?
Дата
Msg-id 87a8gkr8fu.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: No longer possible to query catalogs for index capabilities?  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Ответы Re: No longer possible to query catalogs for index capabilities?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Updated patch. Changes:

  - returns NULL rather than "cache lookup failed"

  - added pg_index_column_has_property (incl. docs)

  - added regression tests

Not changed / need consideration:

  - this still has everything in amapi.c rather than creating any new
    files. Also, the regression tests are in create_index.sql for lack
    of any obviously better place.

The list of column properties is:

  ordered  - (same as "amcanorder" AM capability)
  ordered_asc
  ordered_desc
  ordered_nulls_first
  ordered_nulls_last

If "ordered" is true then exactly one of _asc/_desc and exactly one of
_nulls_first/_last will be true; if "ordered" is false then all the
others will be false too. The intended usage is something like

  CASE WHEN pg_index_column_has_property(idx, attno, 'ordered_asc')
       THEN 'ASC'
       WHEN pg_index_column_has_property(idx, attno, 'ordered_desc')
       THEN 'DESC'
       ELSE ''  -- or NULL
  END

Comments?

--
Andrew (irc:RhodiumToad)


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Proposal for CSN based snapshots
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Proposal for CSN based snapshots