pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCase insensitive string comparison?
5+ messages / 4 participants
[nested] [flat]
* Case insensitive string comparison?
@ 2001-05-15 12:48 Borek Lupoměský <borekl@volny.cz>
0 siblings, 1 reply; 5+ messages in thread
From: Borek Lupoměský @ 2001-05-15 12:48 UTC (permalink / raw)
To: pgsql-sql
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Is there an operator for case insensitive string comparison, or
should I use regular expression matching with ~* '^string$'?
Bye Borek
- --
=====================================================================
BOREK LUPOMESKY Usti nad Labem, Czech Republic, Europe
WWW: http://www.volny.cz/borekl/ PGP keyid: B6A06AEB
==========[ MIME/ISO-8859-2 & PGP encrypted mail welcome ]===========
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: Get GPG key at http://www.volny.cz/borekl/pgp.txt
iD8DBQE7ASWbA6dWI7agausRAj4JAKCk5MCYlsLEjf+IR5ZZfy6ypDNG7QCeJj2n
eyPHuxTW+WQGyeo4SuvZvsw=
=p+pz
-----END PGP SIGNATURE-----
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Case insensitive string comparison?
@ 2001-05-15 13:47 Karel Zak <zakkr@zf.jcu.cz>
parent: Borek Lupoměský <borekl@volny.cz>
0 siblings, 1 reply; 5+ messages in thread
From: Karel Zak @ 2001-05-15 13:47 UTC (permalink / raw)
To: Borek Lupoměský <borekl@volny.cz>; +Cc: pgsql-sql
On Tue, May 15, 2001 at 02:48:24PM +0200, Borek Lupoměský wrote:
> Is there an operator for case insensitive string comparison, or
> should I use regular expression matching with ~* '^string$'?
possibility:
- use upper() / lower() inside query
- regex operators: ~* or !~*
- case insensitive 'like'
Karel
--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Case insensitive string comparison?
@ 2001-05-21 09:15 Cedar Cox <cedarc@visionforisrael.com>
parent: Karel Zak <zakkr@zf.jcu.cz>
0 siblings, 2 replies; 5+ messages in thread
From: Cedar Cox @ 2001-05-21 09:15 UTC (permalink / raw)
To: pgsql-sql
On Tue, 15 May 2001, Karel Zak wrote:
> On Tue, May 15, 2001 at 02:48:24PM +0200, Borek Lupomìský wrote:
> > Is there an operator for case insensitive string comparison, or
> > should I use regular expression matching with ~* '^string$'?
>
> possibility:
>
> - use upper() / lower() inside query
Ok, this is probably a really silly question: which is faster?
I expect they are nearly identical code. Just wondering...
-Cedar
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Case insensitive string comparison?
@ 2001-05-21 11:53 tjk@tksoft.com <tjk@tksoft.com>
parent: Cedar Cox <cedarc@visionforisrael.com>
1 sibling, 0 replies; 5+ messages in thread
From: tjk@tksoft.com @ 2001-05-21 11:53 UTC (permalink / raw)
To: cedarc@visionforisrael.com; +Cc: pgsql-sql
You can index the lower(...) queries, but you can't for the
regex queries.
Troy
>
>
> On Tue, 15 May 2001, Karel Zak wrote:
>
> > On Tue, May 15, 2001 at 02:48:24PM +0200, Borek Lupomìský wrote:
> > > Is there an operator for case insensitive string comparison, or
> > > should I use regular expression matching with ~* '^string$'?
> >
> > possibility:
> >
> > - use upper() / lower() inside query
>
> Ok, this is probably a really silly question: which is faster?
> I expect they are nearly identical code. Just wondering...
>
> -Cedar
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Case insensitive string comparison?
@ 2001-05-21 13:01 Karel Zak <zakkr@zf.jcu.cz>
parent: Cedar Cox <cedarc@visionforisrael.com>
1 sibling, 0 replies; 5+ messages in thread
From: Karel Zak @ 2001-05-21 13:01 UTC (permalink / raw)
To: Cedar Cox <cedarc@visionforisrael.com>; +Cc: pgsql-sql
On Mon, May 21, 2001 at 12:15:41PM +0300, Cedar Cox wrote:
>
> On Tue, 15 May 2001, Karel Zak wrote:
>
> > On Tue, May 15, 2001 at 02:48:24PM +0200, Borek Lupom?ský wrote:
> > > Is there an operator for case insensitive string comparison, or
> > > should I use regular expression matching with ~* '^string$'?
> >
> > possibility:
> >
> > - use upper() / lower() inside query
>
> Ok, this is probably a really silly question: which is faster?
> I expect they are nearly identical code. Just wondering...
>
Only one answer will be right ... try all possibility :-)
IMHO the 'ILIKE' is the most fast, because it's simple for parser and
it's one function.
Karel
--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2001-05-21 13:01 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-15 12:48 Case insensitive string comparison? Borek Lupoměský <borekl@volny.cz>
2001-05-15 13:47 ` Karel Zak <zakkr@zf.jcu.cz>
2001-05-21 09:15 ` Cedar Cox <cedarc@visionforisrael.com>
2001-05-21 11:53 ` tjk@tksoft.com <tjk@tksoft.com>
2001-05-21 13:01 ` Karel Zak <zakkr@zf.jcu.cz>
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