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
327
votes
18 answers

Cannot simply use PostgreSQL table name ("relation does not exist")

I'm trying to run the following PHP script to do a simple database query: $db_host = "localhost"; $db_name = "showfinder"; $username = "user"; $password = "password"; $dbconn = pg_connect("host=$db_host dbname=$db_name user=$username…
Keyslinger
  • 4,903
  • 7
  • 42
  • 50
92
votes
6 answers

PostgreSQL "Column does not exist" but it actually does

I'm writing a Java application to automatically build and run SQL queries. For many tables my code works fine but on a certain table it gets stuck by throwing the following exception: Exception in thread "main" org.postgresql.util.PSQLException:…
BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
63
votes
12 answers

PostgreSQL column 'foo' does not exist

I have a table that has 20 integer columns and 1 text column named 'foo' If I run query: SELECT * from table_name where foo is NULL I get error: ERROR: column "foo" does not exist I have checked myself that his column indeed exists. If I do…
nulltorpedo
  • 1,195
  • 2
  • 12
  • 21
52
votes
3 answers

Why PostgreSQL does not like UPPERCASE table names?

I have recently tried to create some tables in PostgreSQL all in uppercase names. However in order to query them I need to put the table name inside the quotation "TABLE_NAME". Is there any way to avoid this and tell the postgres to work with…
Met Kiani
  • 834
  • 1
  • 9
  • 19
34
votes
3 answers

ERROR: column of relation does not exist PostgreSQL ,Unable to run insert query

Hi I am trying to insert into a table tester3 it fails when i use the syntax insert into tester3 (UN0, UN1) values ( 1, 'jishnu1'); but insert into tester3 values ( 1, 'jishnu1'); is working fine. mydb=# CREATE TABLE tester3 mydb-# ( mydb(# …
Jishnu Prathap
  • 1,955
  • 2
  • 21
  • 37
27
votes
5 answers

PostgreSQL ERROR: 42P01: relation "[Table]" does not exist

I'm having this strange problem using PostgreSQL 9.3 with tables that are created using qoutes. For instance, if I create a table using qoutes: create table "TEST" ("Col1" bigint); the table is properly created and I can see that the quotes are…
Rahul Vijay Dawda
  • 1,123
  • 3
  • 14
  • 36
27
votes
1 answer

sql statement error: "column .. does not exist"

Im trying from postgres console this command: select sim.id as idsim, num.id as idnum from main_sim sim left join main_number num on (FK_Numbers_id=num.id); and I've got this response: ERROR: column "fk_numbers_id" does not exist LINE…
Alessio
  • 423
  • 2
  • 5
  • 9
21
votes
2 answers

When do Postgres column or table names need quotes and when don't they?

Let's consider the following postgres query: SELECT * FROM "MY_TABLE" WHERE "bool_var"=FALSE AND "str_var"='something'; The query fails to respond properly when I remove quotes around "str_var" but not when I do the same around "bool_var". Why?…
Orysza
  • 574
  • 1
  • 5
  • 10
13
votes
1 answer

SQL Server XML Data Type and QUOTED_IDENTIFIER

Can anyone provide insight into this? I've developed an import process using an XML data type. After the data is inserted in to a table by the import sProc I run another procedures to update another table with the imported table. The update…
Rick Putnam
  • 546
  • 1
  • 6
  • 20
11
votes
2 answers

How I can create a table with oracle but with small characters?

How I can create a table with oracle but with small characters, when I create a table with small characters it converts auto to capital characters.
user1384279
  • 113
  • 1
  • 1
  • 4
9
votes
1 answer

Why must quoted_identifier be ON to use a filtered index?

There are plenty of questions here on SO and articles online about how to handle this mess, but my question is more fundamental: WHY? Quoted identifier seems to be a property of how the engine interprets queries, and nothing to do with the data…
gzak
  • 3,908
  • 6
  • 33
  • 56
6
votes
1 answer

Strange behaviour in Postgresql

I'm new to Postgresql and I'm trying to migrate my application from MySQL. I have a table with the following structure: Table "public.tbl_point" Column | Type | Modifiers | Storage |…
user1131031
  • 63
  • 1
  • 3
6
votes
1 answer

I keep getting the error "relation [TABLE] does not exist"

I have been trying to query two tables in my database. In the server explorer I can see both tables and even see the columns within them. We'll call them Schema.table1 and Schema.table2 where "Schema" has its first letter capitalized. I have tried…
Berra2k
  • 318
  • 2
  • 5
  • 16
4
votes
4 answers

Java SQL "ERROR: Relation "Table_Name" does not exist"

I'm trying to connect netbeans to my postgresql database. The connection seems to have worked as I don't get any errors or exceptions when just connecting, methods such as getCatalog() also return the correct answers. But when I try to run a simple…
Matt
  • 3,820
  • 16
  • 50
  • 73
4
votes
1 answer

Oracle ORA-00942: table or view does not exist when it exists

I'm trying to get used to Oracle, installed express one and created by 3rd part program some tables. And when I log in into sqlplus I can not simply use SELECT * FROM table.... SQL> SELECT * FROM tab; TNAME TABTYPE …
Thou
  • 1,055
  • 3
  • 11
  • 16
1
2 3
9 10