First, connect the database
PG installed after the database can be connected with pgadmin, port number, the default PostgreSQL port number is 5432
Second, the data table display
The pgadmin result set Display interface header has two rows, one row is the field name, and one row is the data type of the field.
Third, Postgre query syntax
In the query statement of PostgreSQL, case is not sensitive. and has the following special place:
1, does not support "Top X", it is written as "Limit X". Such as
Select Top 5 * from PERSOM//Error
SELECT * FROM person limit 5//correct query
2. identifiers enclosed by delimited identifiers or quotation marks.
It is formed by enclosing any sequence of characters in double quotation marks ("). Delimited identifiers are always an identifier, not a keyword. Therefore, you can use "select" to indicate a field or table name,
A select without quotation marks is treated as part of a command, so if you use it as a table name or as a field name, a parse error occurs.
Identifiers enclosed in quotation marks can contain any character encoded not equal to zero (to include a double quotation mark, you can write two consecutive double quotes). This allows us to construct table names or field names that would otherwise be disallowed, such as those that contain blanks or numbers (&). But the length limit is still the same.
Enclose an identifier in quotation marks while also making it case-sensitive, and the name without the enclosed quotation marks is always converted to lowercase. For example, we think that the identifier foo, foo, "foo" is an equivalent PostgreSQL name, but "foo" and "foo" is different from the above three and between them.
PostgreSQL always converts unquoted names to lowercase, which is incompatible with the SQL standard, and the SQL standard requires names that are not enclosed in quotation marks to always be capitalized. Therefore, according to the standard,foo equals "foo " but not equal to "foo" .
If you want to write portable programs, we recommend that you either always enclose a name in quotation marks, or never
Use of PostgreSQL