Re: to pg

From: Ladislav Lenart <lenartlad(at)volny(dot)cz>
To: Ramesh T <rameshparnanditech(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: to pg
Date: 2015-09-25 13:44:20
Message-ID: 56054FB4.9020709@volny.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 25.9.2015 13:08, Ramesh T wrote:
> CREATE UNIQUE INDEX idx_load_pick ON pick (case picked when picked='y' then
> load_id else null end );
>
> how can i convert case expressed to postgres..above it is oracle.
>
> any help appreciated...

Hello.

And what about a partial unique index as documented here:

http://www.postgresql.org/docs/9.4/static/indexes-partial.html

I.e.:

CREATE UNIQUE INDEX ON pick (load_id) WHERE picked = 'y';

HTH,

Ladislav Lenart

In response to

  • to pg at 2015-09-25 11:08:44 from Ramesh T

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2015-09-25 13:56:56 Re: to pg
Previous Message Igor Neyman 2015-09-25 13:33:04 Re: to pg