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
[EMAIL PROTECTED] * 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:[EMAIL PROTECTED]
> 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 [EMAIL PROTECTED] so that your
> message can get through to the mailing list cleanly
> 


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to