[SQL] None

2002-09-26 Thread Jordan Reiter


-- 

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 4: Don't 'kill -9' the postmaster



[SQL] Case Sensitive "WHERE" Clauses?

2002-09-26 Thread Jordan Reiter

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



Re: [SQL] Case Sensitive "WHERE" Clauses?

2002-09-26 Thread Jordan Reiter

> > > > Are string comparisons in postgresql case sensitive?
>> >
>> >Yes, unless you specify otherwise.
>> >
>> >Are you sure you are using the right database? I can
>> >reproduce similar results, but only like this:
>>
>> You're using MySQL in these examples .. not Postgres :)
>
>Full points for paying attention ;-)
>
>This, erm, characteristic of the former caused me a lot of grief once...
>
>Anyone know what the ANSI standard is? I don`t recall any other
>database apart from MySQL which default to case-insensitive
>CHAR or VARCHAR columns.

Microsoft Products (SQL Server, Access) are case-insensitive.

I find it hard to understand why it's advantageous that column names are NOT case 
sensitive, while field content is. You have a *lot* more control over the database 
columns than you do over the content that goes into the fields. In my opinion, 
allowing someone to refer to a column as first_name, First_Name, or FIRST_NAME just 
encourages bad programming.
-- 

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 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html