×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Case

Case

(OP)
Hi.

How i can execute a query in PostgreSQL with, case
insensitive and accent insensitive.

Thank's.

Ass.: Fabio Alves Francelino

RE: Case

PostgreSQL keywords, table names, and column names are case-insensitive by default, unless you put quote delimiters around them:

seLeCt "TableName"."ColumnName", "tablename"."columnname" FROM "TableName", "tablename" ordEr By "tablename"."columnname" aSc;


You could even have a table or column called "Select", if you always put it inside quotes, to differentiate it from SQL SELECT.

See http://www.postgresql.org/idocs/index.php?sql-syntax.html for more info.

-------------------------------------------

"Now, this might cause some discomfort..."
(http://www.wired.com/news/politics/0,1283,51274,00.html)

RE: Case

(OP)
You don't understand.

The case is in data into a table.

Example:
Select * from [Table] Where [collum] like 'a%'.

This query must return the records:
A...* return
a...* no return
Á...* no return

I found in help the operator ~~* that works.

Example:
Select * from [Table] Where [collum] ~~* 'a%'.
A...* return
a...* return
Á...* return

But i don't want replace the like operator.

I ask for a solution that works for all queries with like operator.

How a propertie that you set in Server PostGreSQL.

How in the instalation of SQL Server.

Any way thank you

Ass.: Fabio Alves Francelino

RE: Case

For case-insensitive LIKE comparisons, just use the ILIKE operator. (see http://www.postgresql.org/idocs/index.php?functions-matching.html) I don't know if that would work with accented characters, though, so you might have to keep working with regular expressions.

Also, you can cast any string result to lower-case or upper-case, if you want (http://www.postgresql.org/idocs/index.php?functions-string.html):

Select * from [Table] Where lower([column]) like 'a%';
Select * from [Table] Where upper([column]) like 'A%';


-------------------------------------------

"Now, this might cause some discomfort..."
(http://www.wired.com/news/politics/0,1283,51274,00.html)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close