Answer the question
In order to leave comments, you need to log in
Golang jetbrains not reading db in sql?
Hello. Why can't I read sql query in golang jetbrains for example select * from "Groups" Error in Groups. To fix the error, I had to wrap it in quotes.\"Groups"\. Does anyone know a solution or have experienced this. Are the queries going to be more difficult? and I won't be able to solve all the mistakes so easily.
fora8284 on the forum Draw the attention of the administration to this message
Answer the question
In order to leave comments, you need to log in
1. Goland, not Golang. Golang is a language, and what's from JetBrains is an IDE named Goland
2. Learn SQL syntax. "error" has nothing to do with Golan(d|g)
3.
Are the queries going to be more difficult?What you wrote is the most elementary request. It's easier just SELECT 1; Obviously it will be more difficult.
If I understand the question correctly (and this is not easy), then because the SQL language is case insensitive, i.e. the following queries are equivalent:
select * from Groups;
select * from groups;
select * from GROUPS;
SELECT * FROM groups;
SeLeCt * FrOm GrOuPs;
create table Groups ...
will create a table in Postgres named groups
. The query select * from GrOupS;
will also look for a table named groups
. create table "Groups" ...
will create a table named Groups
. The query select * from "GrOupS";
will also look for a table named GrOupS
.create table Groups ...
-- реальное имя таблицы - groups
select * from "Groups"
, the call goes to a table that does not exist Groups
. \dt
, or look at the properties of the table in your environment). If it's not lower-case, use quotation marks with the exact name (e.g. select * from "GROUPS"
), otherwise it's better to do without quotation marks at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question