Re: Differences in WHERE clause of SELECT

From: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
To: "Prabakaran, Vaishnavi" <vaishnavip(at)fast(dot)au(dot)fujitsu(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>
Subject: Re: Differences in WHERE clause of SELECT
Date: 2013-07-11 02:50:10
Message-ID: CAJKUy5jb5oDSW6vBFLRu+SRZR0F4b3HG4m=XGtNhBnkf2J1OCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 10, 2013 at 8:42 PM, Prabakaran, Vaishnavi
<vaishnavip(at)fast(dot)au(dot)fujitsu(dot)com> wrote:
> Hi Berkus,
>
> Thanks for your time and response.
>
> I do understand that there is no LIKE operator support for integers and it would be great if you could help me understand the reason why is it not supported.
>
> My intention is to know whether this is not supported because of any technical limitation or is it against any Postgresql/SQL standards.
>

the latter

> My use cases are like below ones :
> Integer LIKE pattern [ESCAPE escape-character]
> 1. List all the customers who are having negative balance:
> SELECT * from Customer where balance LIKE ‘-%’
>

this is not cleaner implemented this way?
SELECT * FROM customer WHERE balance < 0;

> 2. List all the customers whose id starts with 1:
> SELECT * from Customer where cust_id LIKE ‘1%’
>

there is any real use for that query? i understand if you ask
for all customers whose names begins with 'A' but that the code
begins with '1'?

--
Jaime Casanova www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación
Phone: +593 4 5107566 Cell: +593 987171157

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabrízio de Royes Mello 2013-07-11 03:04:09 Re: Add regression tests for DISCARD
Previous Message Prabakaran, Vaishnavi 2013-07-11 01:42:56 Re: Differences in WHERE clause of SELECT