sudo pacman -S postgresql
$ sudo su - postgres
[sudo] password for ficovh:
[postgres@devel ~]$ initdb -D /var/lib/postgres/data
$ sudo systemctl enable postgresql
$ sudo systemctl start postgresql
$ sudo su - postgres
[sudo] password for ficovh:
[postgres@devel ~]$ psql
psql (16.3)
Type "help" for help.
postgres=# create database customers ;
CREATE DATABASE
postgres=# \c customers ;
You are now connected to database "customers" as user "postgres".
customers=# create schema admindb authorization admindb ;
CREATE SCHEMA
customers=# \q
[postgres@devel ~]$ exit
logout
$ psql -U admindb customers
psql (16.3)
Type "help" for help.
customers=> create table nombres (id serial, nombre varchar(30), email varchar(80));
CREATE TABLE
customers=> \d nombres;
Table "admindb.nombres"
Column | Type | Collation | Nullable | Default
--------+-----------------------+-----------+----------+-------------------------------------
id | integer | | not null | nextval('nombres_id_seq'::regclass)
nombre | character varying(80) | | |
email | character varying(80) | | |