Quantcast
Channel: Planet PostgreSQL
Viewing all articles
Browse latest Browse all 9649

Bruce Momjian: The Double-Quote Trap

$
0
0

While the English language is somewhat fluid in its use of single and double quotation marks, sql is very rigid: single-quotes are used to delimit text strings, and double-quotes can be used to delimit identifiers. What are sql identifiers? They identify an sql object, e.g. if you create a table, the table name and column names are identifiers.

Double-quoting identifiers is usually optional, so either of these is valid:

CREATE TABLE my_table (a INTEGER);
 
CREATE TABLE "my_table" ("a" INTEGER);

Continue Reading »


Viewing all articles
Browse latest Browse all 9649

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>