CREATE UNIQUE INDEX XAK2TRADPAADR_TD ON TRADPAADR_TD(TPID, case TDADRTYP when 'BY' then 0 else TDID end, case TDADRNO when '1' then 0 else TDID end, case TDLANG when 'ENG' then 0 else 1 end);
ERROR: syntax error at or near "case" LINE 4: case TDADRTYP ^ ********** Error **********
ERROR: syntax error at or near "case" SQL state: 42601 Character: 72
You need to put each CASE expression inside parentheses:
CREATE UNIQUE INDEX XAK2TRADPAADR_TD ON TRADPAADR_TD ( TPID, (case TDADRTYP when 'BY' then 0 else TDID end), (case TDADRNO when '1' then 0 else TDID end), (case TDLANG when 'ENG' then 0 else 1 end) ) ;