PostgreSQL's case

1. PostgreSQL database kernel sensitive. Database name, table name, column names are case-sensitive.

2. In PostgreSQL, the implementation of SQL statements, will represent all keywords, database names, table names, column names of the string converted to lowercase. So I said PostgreSQL is not case-sensitive.

3. When writing SQL, for ease of understanding, default: Keyword uppercase first letter capitalized table name, column name all lowercase.

 

Example:

CREATE DATABASE Contact; / * there is a named contact database, Contact database does not exist * /

CREATE DATABASE contact; / * error, contact database already exists * /

CREATE DATABASE "Contact" / * ok, double quotes tell PostgreSQL, do not convert to lowercase * /

to sum up:

A name of the object: such as database names, table names, field names
database kernel is case-sensitive.
Just for ease of use in the analysis of the database SQL scripts, do not double quotes of all object names converted to lowercase.
Unless you object name with quotation marks.
So
1. From table to build applications, or both double quotation marks, or are not added.
2. If you can not do more than this, all the object names to me to write lowercase letters.
3. The string to use single quotes, double quotes used to tell the database do not convert to lower case, the secondary case sensitive.
II. Data
are case sensitive
If LIKE '% a%', it would not expect A

 

Guess you like

Origin www.cnblogs.com/zhenguan/p/11445019.html