Re: simple function index question

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: simple function index question
Дата
Msg-id CAKFQuwYM7XoHOz77zcbuDudXn_iaVuax+2WO24dvHCQKZQKv-w@mail.gmail.com
обсуждение исходный текст
Ответ на simple function index question  (Michael Moore <michaeljmoore@gmail.com>)
Список pgsql-sql
On Tuesday, March 22, 2016, Michael Moore <michaeljmoore@gmail.com> wrote:
This:
CREATE INDEX TX_QSET_DIR_MAP_PRI_URI_TYP_UK
  ON tx_question_set_dir_map
  USING btree
  ((
CASE
  WHEN uri_type = 201900 then 
   (question_set2tx_question_set ,uri_type, null)
  ELSE 
   (question_set2tx_question_set ,uri_type, question_set_dir_map_key)   
END))
TABLESPACE qsn_indx_ol;

 results in 
ERROR:  column "" has pseudo-type record
********** Error **********

ERROR: column "" has pseudo-type record
SQL state: 42P16

Hopefully it is clear what I am attempting to do here. How do I make this happen?

I suspect the system dislikes your attempt to use an anonymous composite as a column in an index.

I question whether what you are trying to do resembles good data modeling.  But if you must you can probably define Ana,Ed composite type and cast the result of the case to it.

David J. 

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

Предыдущее
От: Michael Moore
Дата:
Сообщение: simple function index question
Следующее
От: Rosser Schwarz
Дата:
Сообщение: Re: simple function index question