Re: simple function index question

From: Igor Neyman <ineyman(at)perceptron(dot)com>
To: Michael Moore <michaeljmoore(at)gmail(dot)com>, postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: simple function index question
Date: 2016-03-23 12:56:33
Message-ID: A76B25F2823E954C9E45E32FA49D70ECCD680659@mail.corp.perceptron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org] On Behalf Of Michael Moore
Sent: Tuesday, March 22, 2016 8:24 PM
To: postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: [SQL] simple function index question

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?

Try casting NULL to whatever type question_set_dirmap_key is.
Sai it is varchar, then:
……………………………………………..
WHEN uri_type = 201900 then
(question_set2tx_question_set ,uri_type, null::varchar)
……………………………………………………………….

Regards,
Igor Neyman

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Moore 2016-03-23 15:14:10 Re: simple function index question
Previous Message Rosser Schwarz 2016-03-23 00:54:23 Re: simple function index question