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

Trying to select all rows in this column with a certain value, and failing

I am new to writing raw SQL queries so forgive me for this being easy to solve. The database is Postgres. I have a table similar to: taskId providerName lastScan ignore ================================================== 3 …
plutownium
  • 1,220
  • 2
  • 9
  • 23
0
votes
1 answer

Weird error when trying to query from database

As the title suggests, I have no clue why this doesn't work. If someone can point out what I am doing wrong it would be sweet. Here's the current table rows and cols: Makes table: id | make ----+--------------- 1 | Acura Models Table: …
jhoangqm
  • 55
  • 2
  • 10
0
votes
1 answer

How to insert data into `group` labeled table

I have a database in Postgres that has multiple tables. One of them is group. I know that this is a reserved name. The question is how to insert data into that table.
k1k4ss0
  • 87
  • 10
0
votes
0 answers

When do we use double quotes for table names in SQL?

A SQL coding challenge provided a database; every table was accessible when passed as a string using double quotes and not when passed as a word as I am normally used to. This did not work: SELECT * FROM Athletes; Error message: relation does not…
0
votes
0 answers

mssql to postgresql "as " keyword

Converting ms sql to postgresql. The issue i am having is that it doesn't seem to like the keyword "as" eg with, rtrim(to_char(a.eff_dt,'MM/DD/YYYY')) as 'Execution Date' it doesn't like " as 'Execution Date'". does anybody know a postgresql way to…
jack gell
  • 175
  • 1
  • 8
0
votes
0 answers

Postgres Copy csv to table sql

I am having problems copying a csv into an SQL table that I have already made in pg admin 4 but when I try to use the Copy command to transfer the csv data into the table I keep getting an ERROR relation doesn't exist even though its being made on…
0
votes
1 answer

How to make column name of query result in UPPERCASE

How to make column name of query result in UPPERCASE (Postgres) SELECT USER_NAME, USER_AGE from table; Result user_name user_age First 123 Second 234 Expectation : Result column name to be in uppercase (USER_NAME USER_AGE instead of…
0
votes
1 answer

PostgreSQL disable auto lowercase column name

I have created a PostgreSQL database 12.7 and converted it to an esri geodatbases, then I copied the tables and feature classes from a file geodatabases , this caused the al column names to be lowercases however we are already integrating with an…
MMALSELEK
  • 777
  • 6
  • 13
0
votes
1 answer

Postgres: How to drop a schema which has a double quote included in its name?

I have a schema called "tenant__xyz" in my db but need to drop it. How can I do this? Thank you in advance
Don
  • 366
  • 1
  • 10
0
votes
1 answer

Rename a table in Amazon Redshift

I've been trying to rename a table from "fund performance" to fund_performance in SQLWorkbench for a Redshift database. Commands I have tried are: alter table schemaname."fund performance" rename to fund_performance; I received a message that the…
0
votes
0 answers

Query Error: error: column does not exist

I have created two tables and tried to join them, but it resulted in Query Error. What could be the problem? Here is how I created tables CREATE TABLE Customer ( "Ids" int, "Name" VARCHAR(100), "Gender" VARCHAR(100), "Age" int, …
0
votes
2 answers

displaying column names instead of data from psql terminal

I connect to the remote ubuntu 20.04 computer from the terminal with ssh, connect to the database that I have installed on the postgres user, and I want to see the data in a column with psql commands. I am not displaying the data, but the columns as…
0
votes
1 answer

foreign key camel case issue in postgres on heroku server

i am creating table on heroku successfully but the problems is foreign key when add foreign key it will automatically created in small letter by default postgres accept foreign key like serviceId format this is my table CREATE TABLE…
Shahid
  • 159
  • 5
  • 14
0
votes
1 answer

Relation "department" does not exist EF Core migration error

I'm following the EF Core with MVC tutorial on learn.microsoft.com. I have the following migration: using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace…
0
votes
0 answers

How to display double quotes in Postgres/pgAdmin column

In my new workplace, some of table have column name wrapped with double quote and some of them is not. It's somewhat confusing for me to do some query. So I want to try standardize that to wrapped all column with double quote. But I really don't…