By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,673 Members | 1,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,673 IT Pros & Developers. It's quick & easy.

Case of strings

P: n/a
Hi

I have moved an application from MySQL to PgSQL, and after the making
changes I thought all was ok.

However, I have just realised that

Where A = 'STRING'

Is not the same as

Where A ='String'

Is there anyway I can force the PgSQL to accept case equivalence, or must I
add upper()/lower() to force the case and then make string tests?

Ie Where upper(A)=upper('String')

Many thanx

Simon

Simon Windsor

Eml: si***********@cornfield.org.uk

Tel: 01454 617689

Mob: 07960 321599


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Mailscanner thanks transtec Computers for their support.
Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
On Fri, Feb 27, 2004 at 12:06:58PM -0000, Simon Windsor wrote:
Hi

I have moved an application from MySQL to PgSQL, and after the making
changes I thought all was ok.

However, I have just realised that

Where A = 'STRING'

Is not the same as

Where A ='String'


This is standard SQL. It's possible to use functions inside index
definitions, so you can force case and search on the same.

Michael
--
Michael Darrin Chaney
md******@michaelchaney.com
http://www.michaelchaney.com/

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

Nov 22 '05 #2

P: n/a

On 27/02/2004 12:06 Simon Windsor wrote:
Is there anyway I can force the PgSQL to accept case equivalence, or must
I
add upper()/lower() to force the case and then make string tests?

Ie Where upper(A)=upper('String')


You could use ilike

where a ilike 'string'

You can also use POSIX regular expressions.
--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

---------------------------(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 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.