[BUGS] BUG #14704: How to create unique index with a case statement? - Mailing list pgsql-bugs

From naveen7eceindia@gmail.com
Subject [BUGS] BUG #14704: How to create unique index with a case statement?
Date
Msg-id 20170613052449.26508.23783@wrigleys.postgresql.org
Whole thread Raw
Responses Re: [BUGS] BUG #14704: How to create unique index with a case statement?  (Pantelis Theodosiou <ypercube@gmail.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14704
Logged by:          Naveen Vemula
Email address:      naveen7eceindia@gmail.com
PostgreSQL version: 9.6.0
Operating system:   Windows
Description:

CREATE UNIQUE INDEX XAK2TRADPAADR_TD     ON TRADPAADR_TD(TPID,
case TDADRTYP when 'BY' then 0  else TDID
end,
case TDADRNO when '1' then 0else TDID
end,
case TDLANG when 'ENG' then 0else 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

Here TDADRTYP - varchar(4)
TDID - bigint
TDADRNO -  varchar(15)
TDLANG  - varchar(4)



--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [BUGS] BUG #14699: Statement trigger and logical replication
Next
From: Pantelis Theodosiou
Date:
Subject: Re: [BUGS] BUG #14704: How to create unique index with a case statement?