PostgreSQL Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 42: Line 42:


==Timestamp==
==Timestamp==
==Numeric Types==
* https://www.postgresql.org/docs/9.1/static/datatype-numeric.html
===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==

Revision as of 20:45, 18 October 2018

Internal

Database

A PostgresSQL usually comes with 4 pre-existing databases (admin, postgres, 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.

User Operations

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

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