Re: Case Sensitive "WHERE" Clauses?

From: Andrew Perrin <clists(at)perrin(dot)socsci(dot)unc(dot)edu>
To: Jordan Reiter <jordan(at)breezing(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Case Sensitive "WHERE" Clauses?
Date: 2002-09-26 18:22:55
Message-ID: Pine.LNX.4.21.0209261421270.11079-100000@perrin.socsci.unc.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

No, I don't think it's supposed to be case-sensitive. In any case, whether
it's supposed to be or not, it certainly isn't in practice.

Solutions include:

SELECT *
FROM People
WHERE lower(first_name)='jordan';

and:

SELECT *
FROM People
WHERE first_name ~* 'Jordan';

ap

----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists(at)perrin(dot)socsci(dot)unc(dot)edu * andrew_perrin (at) unc.edu

On Thu, 26 Sep 2002, Jordan Reiter wrote:

> Are string comparisons in postgresql case sensitive?
>
> I keep on having this response:
>
> SELECT *
> FROM People
> WHERE first_name='jordan'
>
> Result: 0 records
>
> SELECT *
> FROM People
> WHERE first_name='Jordan'
>
> Result: 1 record
>
> I though that string matching in SQL was case-insensitive. Isn't this correct? If not, what workarounds have been used successfully before? Obviously, formatting the search string for the query is not a solution...
> --
>
> Jordan Reiter mailto:jordan(at)breezing(dot)com
> Breezing.com http://breezing.com
> 1106 West Main St phone:434.295.2050
> Charlottesville, VA 22903 fax:603.843.6931
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rajesh Kumar Mallah. 2002-09-26 19:00:16 Preventing DELETEs
Previous Message Rajesh Kumar Mallah. 2002-09-26 18:13:16 Re: check source of trigger