Questions tagged [quoted-identifier]

Use this tag for questions involving SQL delimited identifiers (quoted identifiers.)

In SQL, a delimited identifier (also referred to as "quoted identifier") is an identifier (name) enclosed in double quotes.

Delimited identifiers are special in two aspects:

• They can contain characters normally not supported in SQL identifiers. (E.g. "!# odd column name".)

• They can be identical to a reserved word. (E.g. "YEAR".)

Two consecutive double quotation marks within a delimited identifier are interpreted as one double quotation mark. (E.g. "12"" vinyl".)

SQL is by default case insensitive. To make an identifier (name) case sensitive it needs to be quoted. "Some_Table", "SOME_TABLE" and "some_table" are different names because they are quoted. The names some_table, SOME_TABLE and Some_Table are identical names because they are not quoted.

The SQL standard defines the double quote " as the quoting character (single quotes: ' are for string literals.) Some DBMS products deviate from the standard and allow alternative quoting characters. Microsoft SQL Server uses square brackets: [Some_Table] and MySQL uses backticks `Some_Table`.

148 questions
0
votes
0 answers

SQL not recognising table columns in ON statement

I have this SQL query: SELECT "Segments.Id", "AggregatedValues.Segment" FROM "Segments" INNER JOIN "AggregatedValues" ON "Segments.Id" = "AggregatedValues.Segment"; And I get the following error: ERROR: column "Segments.Id" does not exist LINE 1:…
Sergi Doce
  • 13
  • 3
0
votes
1 answer

ProgrammingError when trying to skip duplicate data in postgres sql

PostGres SQL will not accept data which is in violation of primary key. To ignore the duplicate data, I have this code: import pandas as pd import psycopg2 import os import matplotlib from sqlalchemy import create_engine from tqdm import…
Slartibartfast
  • 1,058
  • 4
  • 26
  • 60
0
votes
2 answers

PostgreSQL - No records returned with INNER JOIN but INNER JOIN is working with MS SQL Server

I have migrated some tables and table data from MS SQL Server to PostgreSQL. The Data on both the sides is identical. However, when I am trying to query two tables using INNER JOIN in MS SQL Server and PostgreSQL the results are different. With MS…
ManojRawat
  • 61
  • 1
  • 8
0
votes
1 answer

MySQL to Postgresql backup invalid command due to "`"?

I have an old backup sql file with ` in it. When I try to load it via psql dbname < db_backup.sql I get an error: ERROR: syntax error at or near "`" DROP TABLE IF EXISTS `tablename`; Is there a way to tell psql to treat ` like '?
Some Guy
  • 12,768
  • 22
  • 58
  • 86
0
votes
0 answers

Snowflake - Unable to Drop Column after Changing the QUOTED_IDENTIFIERS_IGNORE_CASE parameter

I'm new to Snowflake and currently trying to migrate some data into Snowflake for testing, and the db (Redshift) I'm migrating data from treats double-quoted identifiers as case-insensitive. To ensure all our existing SQL queries also work in…
0
votes
1 answer

while querying through createNativeQuery() with a column name which is a mixed of uppercase and lower case is getting converted into lower case

while querying through createNativeQuery() with a column name which is a mixed of uppercase and lower case is getting converted into lower case. Below is my code Query query = entityManager.createNativeQuery("SELECT distinct a.admission_type_L1 FROM…
0
votes
0 answers

Pgadmin is not able to read the column names due to header in column name

I want to join the underneath tables. In order to do that, please see the underneath code. However, it is not possible to read the code due to the following error, since it is not able to read the header of municipilacity. SELECT …
user17403003
0
votes
1 answer

Column doesnot exist error in PostgreSQL command

I have been trying to get the result of a PostgreSQL command. I am getting the following error. I want to get the video id, video name and the created date for that specific video. I have all the required columns in the table as shown below:
Smile Kisan
  • 191
  • 4
  • 19
0
votes
2 answers

ERROR: column "username" of relation "public.ae_User" does not exist - Postgresql

I'm learning postgresql and make this table in elephantsql: CREATE TABLE "public.ae_User" ( "Id" serial NOT NULL, "Name" character varying(30) NOT NULL, "Username" character varying(16) NOT NULL UNIQUE DEFAULT 'Guest', "Email"…
Codigo de Senior
  • 152
  • 1
  • 10
0
votes
2 answers

Is it mandatory to use "" around the table name performing query on PostgreSQL?

I am not so into PostgreSQL and pgAdmin 4 and I have the following doubt. Following a screenshot of what I can see in my pgAdmin4: As you can see it is performing this very simple query: SELECT * FROM public."Example" ORDER BY id ASC The thing…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
0
votes
0 answers

Azure Data Studio not respect specified casing with PostgreSQL

Using Azure Data Studio with PostgreSQL Extension, the soft change the case of query, that leads to error. Here is my Query : SELECT * FROM workspaces JOIN member on workspaces.id = member.workspaceId Here is the error: column member.workspaceid…
Alexy
  • 780
  • 6
  • 22
0
votes
1 answer

Spring Boot PostgreSQL column does not exist error with Docker

I am using Spring Boot with PostgreSQL. I want to save my Entity objects in the database but when I try to do so, an error message appears: spring | 2021-10-11 08:08:59.634 WARN 1 --- [ Thread-40] o.h.engine.jdbc.spi.SqlExceptionHelper :…
user16806803
0
votes
0 answers

problem with column name with uppercase in application code

We are migrating applications from SQL Server to PostgreSQL. All the tables and columns are defined in lowercase. Trying to migrate all the programs that worked with SQL Server, we get an error with the columns names. In our code, the columns are…
meirben
  • 3
  • 1
0
votes
0 answers

How to use keyword in Postgres namespace?

I have a Postgres db. The tables are each in separate namespaces, which are named using two character state codes. The problem is this: for the state Indiana, the state code is "in". I am trying to execute this query: SELECT city_name FROM…
Blighty
  • 199
  • 5
  • 20
0
votes
1 answer

what is the best way to handle reserved key words of PostgreSQL when using Mybatis

when I created a column like name or password and so on in PostgreSQL 13. The PostgreSQL may seem it as a reserved key word. so the MyBatis SQL would like this: INSERT INTO apple_server_notification_record (created_time, updated_time,…
Dolphin
  • 29,069
  • 61
  • 260
  • 539