Sql retrieval from indigo sql dB

Posted on
Thu Aug 06, 2020 9:34 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Sql retrieval from indigo sql dB

It looks like the state name “index” creates a problem when retrieving from the sql database

To get column index one has to use
“index” in Postgres
[index] in SQLite

But then the case of the letters is checked

It looks like indigo stores the state names in lowercase so for eg state myValue
We have to use
“myvalue”
And
[myvalue]
With lowercase v

??

That’s what makes it interesting

Just asking if this is correct

Karl


Sent from my iPhone using Tapatalk

Posted on
Fri Aug 07, 2020 10:19 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Sql retrieval from indigo sql dB

That sounds pretty much correct -- at least from a Postgres standpoint. By default, the database will make everything lower case (not just Indigo) if you do not explicitly create it case sensitive (e.g.by enclosing it in quotes during creation). It is generally considered a bad practice to use mixed-case with Postgres because if you create a column as "karl_Column" then forever more you must quote it and be case sensitive. Conversely, when escaping the column name via quotes, you are asking it to be case sensitive so "karl_column" no longer would find one created as "karl_Column".

Any keyword used as a column name will have to be enclosed to be used as a column... that is what you are seeing with index but it isn't limited to just that column name of course.

Adam

Posted on
Fri Aug 07, 2020 10:58 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Sql retrieval from indigo sql dB

thanks...

so using "index" as a state name makes people learn something :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests