pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Doing case-insensitive queries.
2+ messages / 2 participants
[nested] [flat]

* Doing case-insensitive queries.
@ 1998-05-26 17:24 Dana M. Epp <eppdm@netmaster.ca>
  1998-05-26 17:34 ` Re: [SQL] Doing case-insensitive queries. The Hermit Hacker <scrappy@hub.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Dana M. Epp @ 1998-05-26 17:24 UTC (permalink / raw)
  To: pgsql-sql

I am trying to query a database case-insenstively on a char() field, and
failing miserably. Could anyone direct me to some documentation that
properly explains how to accomplish such a task in PostgreSQL.

Items like ~* don't work when using the LIKE for me.

Here is my current code segment on how I am doing this query with case
sensitivity.


   $qstring = "select * from $database where vendor LIKE
\'\%$inqstring\%\' ; "; 

   $result = $con->exec($qstring);

Can anyone tell me how I could query that without case-sensitivity?

-- 
Dana M. Epp
eppdm@netmaster.ca

NetMaster Networking Solutions, Inc.
http://www.netmaster.ca

"Connecting networks to the Internet"



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] Doing case-insensitive queries.
  1998-05-26 17:24 Doing case-insensitive queries. Dana M. Epp <eppdm@netmaster.ca>
@ 1998-05-26 17:34 ` The Hermit Hacker <scrappy@hub.org>
  0 siblings, 0 replies; 2+ messages in thread

From: The Hermit Hacker @ 1998-05-26 17:34 UTC (permalink / raw)
  To: Dana M. Epp <eppdm@netmaster.ca>; +Cc: pgsql-sql

On Tue, 26 May 1998, Dana M. Epp wrote:

> I am trying to query a database case-insenstively on a char() field, and
> failing miserably. Could anyone direct me to some documentation that
> properly explains how to accomplish such a task in PostgreSQL.
> 
> Items like ~* don't work when using the LIKE for me.
> 
> Here is my current code segment on how I am doing this query with case
> sensitivity.
> 
> 
>    $qstring = "select * from $database where vendor LIKE
> \'\%$inqstring\%\' ; "; 
> 
>    $result = $con->exec($qstring);
> 
> Can anyone tell me how I could query that without case-sensitivity?

select * from $database where vendor *~ '$inqstring';

	I might have that *~ backwards...if that fails, try ~* :(





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1998-05-26 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-05-26 17:24 Doing case-insensitive queries. Dana M. Epp <eppdm@netmaster.ca>
1998-05-26 17:34 ` The Hermit Hacker <scrappy@hub.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox