472,371 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

case-insensitive database

Is there a way to make Postgresql case-INSENSITIVE?

Thanks
Nov 11 '05 #1
12 21349
Quoth "Relaxin" <no****@spam.com>:
Is there a way to make Postgresql case-INSENSITIVE?


It already is.

portfolio=# select * from stocks limit 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

portfolio=# sELeCT * FROM STOCKS LIMIT 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

Those queries were cased differently, but were recognized as being
functionally identical.
--
output = ("aa454" "@" "freenet.carleton.ca")
http://cbbrowne.com/info/linux.html
debugging, v:
Removing the needles from the haystack.
Nov 11 '05 #2
Quoth "Relaxin" <no****@spam.com>:
Is there a way to make Postgresql case-INSENSITIVE?


It already is.

portfolio=# select * from stocks limit 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

portfolio=# sELeCT * FROM STOCKS LIMIT 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

Those queries were cased differently, but were recognized as being
functionally identical.
--
output = ("aa454" "@" "freenet.carleton.ca")
http://cbbrowne.com/info/linux.html
debugging, v:
Removing the needles from the haystack.
Nov 11 '05 #3
No, I mean the data.

select * from stocks where symbol = 'AADBX'
and
select * from stocks where symbol = 'aadbx'

would bring up the same result set.
"Christopher Browne" <cb******@acm.org> wrote in message
news:m3************@chvatal.cbbrowne.com...
Quoth "Relaxin" <no****@spam.com>:
Is there a way to make Postgresql case-INSENSITIVE?


It already is.

portfolio=# select * from stocks limit 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

portfolio=# sELeCT * FROM STOCKS LIMIT 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

Those queries were cased differently, but were recognized as being
functionally identical.
--
output = ("aa454" "@" "freenet.carleton.ca")
http://cbbrowne.com/info/linux.html
debugging, v:
Removing the needles from the haystack.

Nov 11 '05 #4
No, I mean the data.

select * from stocks where symbol = 'AADBX'
and
select * from stocks where symbol = 'aadbx'

would bring up the same result set.
"Christopher Browne" <cb******@acm.org> wrote in message
news:m3************@chvatal.cbbrowne.com...
Quoth "Relaxin" <no****@spam.com>:
Is there a way to make Postgresql case-INSENSITIVE?


It already is.

portfolio=# select * from stocks limit 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

portfolio=# sELeCT * FROM STOCKS LIMIT 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

Those queries were cased differently, but were recognized as being
functionally identical.
--
output = ("aa454" "@" "freenet.carleton.ca")
http://cbbrowne.com/info/linux.html
debugging, v:
Removing the needles from the haystack.

Nov 11 '05 #5
Relaxin wrote:
No, I mean the data.

select * from stocks where symbol = 'AADBX'
and
select * from stocks where symbol = 'aadbx'

would bring up the same result set.

Look in the manuals, there are SQL functions like:

STRTOLOWER( ); STRTOUPPER() like those in 'C'

Usage:
-------
SELECT *
FROM stocks
WHERE
STRTOLOWER( symbol ) = STRTOLOWER( 'AADBX' );

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

Nov 11 '05 #6
Hello....
Does anyone understand what is meant by a case-insensitive database.

Are there some collations that can be changed or is there just no way to
have a true case-insensitive Postgresql database?

Thanks

"Dennis Gearon" <ge*****@fireserve.net> wrote in message
news:3F**************@fireserve.net...
Relaxin wrote:
No, I mean the data.

select * from stocks where symbol = 'AADBX'
and
select * from stocks where symbol = 'aadbx'

would bring up the same result set.

Look in the manuals, there are SQL functions like:

STRTOLOWER( ); STRTOUPPER() like those in 'C'

Usage:
-------
SELECT *
FROM stocks
WHERE
STRTOLOWER( symbol ) = STRTOLOWER( 'AADBX' );

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

Nov 11 '05 #7

On Sat, 13 Sep 2003, Relaxin wrote:
Is there a way to make Postgresql case-INSENSITIVE?


Case insensitive in what regard?
That textual comparisons are done case-insensitively in queries?
That object names are determined case-insensitively?
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #8
select * from stocks where lower(symbol) = 'aadbx';
or
select * from stocks where symbol ilike =aadbx';
or
select * from stocks where symbol ~* 'aadbx';
HTH
Darren
On Sat, 13 Sep 2003, Relaxin wrote:
No, I mean the data.

select * from stocks where symbol = 'AADBX'
and
select * from stocks where symbol = 'aadbx'

would bring up the same result set.
"Christopher Browne" <cb******@acm.org> wrote in message
news:m3************@chvatal.cbbrowne.com...
Quoth "Relaxin" <no****@spam.com>:
Is there a way to make Postgresql case-INSENSITIVE?


It already is.

portfolio=# select * from stocks limit 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

portfolio=# sELeCT * FROM STOCKS LIMIT 1;
symbol | description | exchange
--------+-------------+----------
AADBX | AADBX | NYSE
(1 row)

Those queries were cased differently, but were recognized as being
functionally identical.
--
output = ("aa454" "@" "freenet.carleton.ca")
http://cbbrowne.com/info/linux.html
debugging, v:
Removing the needles from the haystack.


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org


--
Darren Ferguson
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #9

On Sat, 13 Sep 2003, Relaxin wrote:
No, I mean the data.

select * from stocks where symbol = 'AADBX'
and
select * from stocks where symbol = 'aadbx'

would bring up the same result set.


Potentially on some systems it'd be possible to
generate a case insensitive collation as part of a locale
and then use such for LC_COLLATE on initdb which would make all
comparisons of text fields case insensitive. That wouldn't
let you choose some case sensitive and case insensitive
right now (until we supported different collations within
one database). Others have already given most of the normal
query change ways already I believe (ilike, using upper or
lower, etc).

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #10
Thank you, that was the answer I was look for.

"Stephan Szabo" <ss****@megazone.bigpanda.com> wrote in message
news:20*******************@megazone.bigpanda.com.. .

On Sat, 13 Sep 2003, Relaxin wrote:
No, I mean the data.

select * from stocks where symbol = 'AADBX'
and
select * from stocks where symbol = 'aadbx'

would bring up the same result set.


Potentially on some systems it'd be possible to
generate a case insensitive collation as part of a locale
and then use such for LC_COLLATE on initdb which would make all
comparisons of text fields case insensitive. That wouldn't
let you choose some case sensitive and case insensitive
right now (until we supported different collations within
one database). Others have already given most of the normal
query change ways already I believe (ilike, using upper or
lower, etc).

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #11
Stephan Szabo <ss****@megazone.bigpanda.com> writes:
Potentially on some systems it'd be possible to
generate a case insensitive collation as part of a locale
and then use such for LC_COLLATE on initdb which would make all
comparisons of text fields case insensitive.


Another possibility is to create a 'case insensitive text' datatype
that has its own case-insensitive comparison operators and associated
btree opclass. You would want to create an implicit cast to text and
an automatic cast from text so as to take advantage of the existing
text-type operations. I'm not sure whether this would work cleanly
or would result in can't-choose-the-operator-to-use errors, but it'd
be worth trying.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #12
Relaxin wrote:
Hello....
Does anyone understand what is meant by a case-insensitive database.

You could define your own encoding, and use that.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
9
by: Kevin | last post by:
Hi, I am getting a syntax error Microsoft VBScript compilation error '800a03ea' Syntax error On the code below. The error references the "End Select" line Can anyone help me with what I am...
19
by: Robert Scheer | last post by:
Hi. In VBScript I can use a Select Case statement like that: Select Case X Case 1 to 10 'X is between 1 and 10 Case 11,14,16 'X is 11 or 14 or 16 End Select
1
by: ST | last post by:
Hi, I'm trying to debug someone else's code, and I'm going thru this Select Case statement. I'm having problems with the "OTHER" case...in that when the first line of the case is false, it jumps...
2
by: cs168 | last post by:
Hi I am new in ASP programming so I do use the very basic and simple way to do all my stuff. Now I do really got stuck at how can I loop thru the calculation for all my selection.. My full code is as...
6
by: deanfamily11 | last post by:
I've set up a case statement to have my program determine where on the Cartesian plane a point the user enters is located. I keep getting the C2051 error when I compile. Any help? #include...
15
by: YitzHandel | last post by:
The following is an extract from my program, which I seperated out and compiled as its own program. The problem is that as soon as a case tests true, all the cases below it execute as well. So...
10
by: MLH | last post by:
Suppose the following... Dim A as Date A=#7/24/2005# I wish to compare value of A against 2 other values: 1) 8/1/2005 2) 9/1/2005 Which is better and why... First:
7
by: Lauren Quantrell | last post by:
Is there any speed/resource advantage/disadvantage in using Select Case x Case 1 Case 2 etc. many more cases... End Select VS.
10
by: Chih-Hsu Yen | last post by:
I encountered a strange problem about switch-case statement. switch(cmd) { case 1: statements; break; case 2: statements; break; ... .... case 11: S1; S2; S3; statements;
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.