PostgreSQL Concepts: Difference between revisions
Jump to navigation
Jump to search
(→TCP) |
|||
Line 10: | Line 10: | ||
==TCP== | ==TCP== | ||
The default port is 5432. | |||
=Database= | =Database= |
Revision as of 18:27, 4 December 2018
Internal
Connection Types
Local Socket
This is the default type of connection, then the psql client is collocated with the database.
TCP
The default port is 5432.
Database
A PostgresSQL usually comes with 4 pre-existing databases (postgres, admin, template0, template1). "postgres" is fit for general use and it should be used by default.
Schema
Each database has by default a public schema.
Tablespace
Authentication
User
Users are shared across databases.
The "user" concept is equivalent with the "role" concept. They mean the same thing.
Role
The "role" concept is equivalent with the "user" concept. They mean the same thing.
Role Attributes
A specific role may:
- be a superuser
- create another role
- create a database
Data Types
Identity
- http://www.postgresqltutorial.com/postgresql-identity-column/
- http://www.postgresqltutorial.com/postgresql-serial/
Timestamp
Numeric Types
SMALLINT
2 byte integer.
INT
4 byte integer. This is a typical choice for integers.
BIGINT
8 byte integer.
DECIMAL
NUMERIC
REAL
DOUBLE PRECISION
SERIAL
BIGSERIAL
TODO