# Postgres

SQL DB with:

* Streaming replication
* Schemas
* User-defined objects like operators, data types, and functions
* Nested transactions
* Table inheritance
* Partitioning
* Several unusual data types, like Money, Geometry, IP addresses, JSON, and data ranges.
* Can execute stored procedures in over a dozen programming languages, including Java, Perl, Python, Ruby, and C/C++.

## Types

| **Character Types**                  | **Description**            |
| ------------------------------------ | -------------------------- |
| character varying(_n_), varchar(_n_) | variable-length with limit |
| character(_n_), char(_n_)            | fixed-length, blank padded |
| text, varchar                        | variable unlimited length  |

If you do not specify the n integer for the `varchar` data type, it behaves like the `text` data type. The performance of the `varchar` (without n) and `text` are the same.

## Psql

* `\du` to see users installed
* `\list`: lists all the databases in Postgres
* `\connect`: connect to a specific database
* `\dt`: list the tables in the currently connected database
