Re: Case insensivity

496 views
Skip to first unread message

Josiah Carlson

unread,
Aug 19, 2012, 3:33:22 PM8/19/12
to redi...@googlegroups.com
Most databases have case-insensitive commands. Think SQL: 'select' is
the same as 'SELECT' is the same as 'SeLeCt'. To do something
different in this regard (specifically to have 'get', 'GET', and 'Get'
do something different) would be arguably insane. Never mind
confusing.

Regards,
- Josiah

On Sun, Aug 19, 2012 at 8:58 AM, mcgushee <mattg...@gmail.com> wrote:
> Hmm, I thought I already posted this ... apologies if it appears twice. But
> anyway, I have been experimenting with the Redis client for Chicken Scheme,
> have come across a couple of issues, and started digging into the code.
> Along the way I noticed that all the commands issued to Redis pass through
> the STRING-UPCASE function (should be obvious what that does, no?). And that
> raises the question ... at least for me (Redis 2.4.15 on Linux), Redis
> commands are actually case-insensitive. But are they that way by design, and
> likely to remain so in the future, or is that an incidental feature of the
> current implementation? I've looked in the docs, but can't find any
> statement addressing this question. Thanks for all info!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/redis-db/-/oSvnF0z0KcoJ.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.

Jay A. Kreibich

unread,
Aug 19, 2012, 6:48:08 PM8/19/12
to redi...@googlegroups.com
On Sun, Aug 19, 2012 at 08:58:54AM -0700, mcgushee scratched on the wall:

> Redis commands are actually case-insensitive.

Yes. Keys are not, but commands and keywords are case-insensitive.

> But are they that way by design,

Yes.

> and likely to remain so in the future,

Yes.

> or is that an incidental feature of the current implementation?

No, it is quite intentional.

-j

--
Jay A. Kreibich < J A Y @ K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
but showing it to the wrong people has the tendency to make them
feel uncomfortable." -- Angela Johnson

mcgushee

unread,
Aug 19, 2012, 7:43:26 PM8/19/12
to redi...@googlegroups.com, j...@kreibi.ch
Hi, and thanks for the responses.


On Sunday, August 19, 2012 4:48:08 PM UTC-6, Jay Kreibich wrote:

> or is that an incidental feature of the current implementation?

  No, it is quite intentional.

Okay, good. Then I will propose getting rid of the STRING-UPCASE. No sense doing string manipulations that aren't required.

--
Matt Gushee 

 

Jay A. Kreibich

unread,
Aug 19, 2012, 10:14:04 PM8/19/12
to mcgushee, redi...@googlegroups.com
On Sun, Aug 19, 2012 at 04:43:26PM -0700, mcgushee scratched on the wall:
My guess (and without looking at the code this is a wild guess) is
that the function call is used to standardize command representation
in AOL files and replication streams. While it may not be strictly
required, it does serve a purpose.

mcgushee

unread,
Aug 20, 2012, 12:54:31 PM8/20/12
to redi...@googlegroups.com, mcgushee, j...@kreibi.ch
Hi, Jay--

On Sunday, August 19, 2012 8:14:04 PM UTC-6, Jay Kreibich wrote:

> Okay, good. Then I will propose getting rid of the STRING-UPCASE. No sense
> doing string manipulations that aren't required.

  My guess (and without looking at the code this is a wild guess) is
  that the function call is used to standardize command representation
  in AOL files and replication streams.  While it may not be strictly
  required, it does serve a purpose.

Haha! That "AOL files" phrase threw me for a loop! I guess that refers to Redis's append-only files--didn't know they were called by that acronym--so I Googled it and found a ton of irrelevant hits, mostly referring to a certain internet provider (or is that "internet withholder"?). BTW, does anyone still use AOL?

But on to business: thanks for the heads-up. Actually, the library I'm working with is pretty rudimentary, so I'm not sure that much thought went into it. But I'll investigate a bit more. Though it's a very easy change to make and unmake--it's just a single function call in a macro that transforms all the scheme functions into Redis commands (is my smug-Lisp-weenieism showing?).

--
Matt Gushee 

Josiah Carlson

unread,
Aug 20, 2012, 1:00:47 PM8/20/12
to redi...@googlegroups.com, mcgushee, j...@kreibi.ch
On Mon, Aug 20, 2012 at 9:54 AM, mcgushee <mattg...@gmail.com> wrote:
> Hi, Jay--
>
> On Sunday, August 19, 2012 8:14:04 PM UTC-6, Jay Kreibich wrote:
>
>> > Okay, good. Then I will propose getting rid of the STRING-UPCASE. No
>> > sense
>> > doing string manipulations that aren't required.
>>
>> My guess (and without looking at the code this is a wild guess) is
>> that the function call is used to standardize command representation
>> in AOL files and replication streams. While it may not be strictly
>> required, it does serve a purpose.
>
> Haha! That "AOL files" phrase threw me for a loop! I guess that refers to
> Redis's append-only files--didn't know they were called by that acronym--so
> I Googled it and found a ton of irrelevant hits, mostly referring to a
> certain internet provider (or is that "internet withholder"?). BTW, does
> anyone still use AOL?

In the context of Redis, they are usually called "AOF" for
"append-only files". "AOL Files" would seem to suggest "append-only
log files", but it's not common parlance here.

As for anyone still using AOL, there are actually a surprisingly large
number of people who still use it. Perhaps no one on this list pays
for net access through them, but they still had over 3 million
subscribers as of the summer of 2011.

> But on to business: thanks for the heads-up. Actually, the library I'm
> working with is pretty rudimentary, so I'm not sure that much thought went
> into it. But I'll investigate a bit more. Though it's a very easy change to
> make and unmake--it's just a single function call in a macro that transforms
> all the scheme functions into Redis commands (is my smug-Lisp-weenieism
> showing?).

We don't need macros on the Python side of things to get the same
result :P (though the current Python libraries pre-define them to
offer help, additional syntax conveniences, etc.)

Regards,
- Josiah

Jay A. Kreibich

unread,
Aug 20, 2012, 10:18:00 PM8/20/12
to mcgushee, redi...@googlegroups.com
On Mon, Aug 20, 2012 at 09:54:31AM -0700, mcgushee scratched on the wall:
> On Sunday, August 19, 2012 8:14:04 PM UTC-6, Jay Kreibich wrote:

> > My guess (and without looking at the code this is a wild guess) is
> > that the function call is used to standardize command representation
> > in AOL files and replication streams. While it may not be strictly
> > required, it does serve a purpose.

> Haha! That "AOL files" phrase threw me for a loop! I guess that refers to
> Redis's append-only files--didn't know they were called by that acronym

Err... they're not. As others pointed out, I meant AOF.

> But on to business: thanks for the heads-up. Actually, the library I'm
> working with is pretty rudimentary, so I'm not sure that much thought went
> into it.

For some reason I was thinking you were looking at the Redis
internals. If the call is in some external library, then I have no
idea what purpose it might serve.

Salvatore Sanfilippo

unread,
Aug 22, 2012, 5:10:04 AM8/22/12
to redi...@googlegroups.com
Hello!

We have a plan to change the behaviour of commands typed all small
caps but starting or ending with a capital letter, to pick different
CAP tradeoffs.

So for instance "Set" will act as a CP system from the point of view
of CAP, while "seT" will act as a CA system.

Just kidding of course ;) You are free to type commands As YoU WaNt.

Salvatore

On Sun, Aug 19, 2012 at 5:58 PM, mcgushee <mattg...@gmail.com> wrote:
> Hmm, I thought I already posted this ... apologies if it appears twice. But
> anyway, I have been experimenting with the Redis client for Chicken Scheme,
> have come across a couple of issues, and started digging into the code.
> Along the way I noticed that all the commands issued to Redis pass through
> the STRING-UPCASE function (should be obvious what that does, no?). And that
> raises the question ... at least for me (Redis 2.4.15 on Linux), Redis
> commands are actually case-insensitive. But are they that way by design, and
> likely to remain so in the future, or is that an incidental feature of the
> current implementation? I've looked in the docs, but can't find any
> statement addressing this question. Thanks for all info!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/redis-db/-/oSvnF0z0KcoJ.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.



--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org

Beauty is more important in computing than anywhere else in technology
because software is so complicated. Beauty is the ultimate defence
against complexity.
— David Gelernter
Reply all
Reply to author
Forward
0 new messages