Databases
PostgreSQL
Local Installation
PostgreSQL is a powerful, open source object-relational database system that uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads.
Below are the PostgreSQL versions that have active security support:
| Version | Release Date | Security Support |
|---|---|---|
| 18 | 2025-09-25 | 2030-11-14 |
| 17 | 2024-09-26 | 2029-11-08 |
| 16 | 2023-09-14 | 2028-11-09 |
| 15 | 2022-10-13 | 2027-11-11 |
| 14 | 2021-09-30 | 2026-11-12 |
PostgreSQL installation details can be found at https://www.postgresql.org/docs/current/tutorial-install.html
- macOS
- Windows
- Linux
brew install postgresql@18
First you need to install Windows Subsystem for Linux (WSL).
Follow the instructions at https://docs.microsoft.com/en-us/windows/wsl/install
- Download the installer from the official website: https://www.postgresql.org/download/windows/
- Run the installer as administrator.
- Follow the wizard steps (
Next,Next) - Set a password for the
postgresuser - Leave the default port (
5432) - Optionally you can install
pgAdmin, the graphical tool to manage your database.
Linux is not officially supported at LATAM Airlines.
sudo apt install postgresql postgresql-contrib
psql --version
Using PostgreSQL in containers
docker run --name postgres -e POSTGRES_PASSWORD=<PASSWORD> -d postgres:18
-
Validate the container:
docker container ps -
Inspect data:
docker inspect <CONTAINER_ID> (Ex default ip 172.17.0.2)
Initial PostgreSQL Configuration
- Log in without password:
sudo -u usuario psql base_datos
- Change password:
ALTER USER usuario WITH PASSWORD new_password;
Java Driver Installation (JDBC)
In case you don't have the postgres driver, download it from the official repository:
Run command:
wget https://jdbc.postgresql.org/download/postgresql-42.7.8.jar
To include it in a Maven project, add the following dependency in the pom.xml file:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.8</version>
</dependency>
Liquibase
Liquibase is an open source database schema change management solution that allows you to manage revisions of your database changes easily. Liquibase makes it easy for anyone involved in the application release process:
- Eliminates errors and delays when releasing databases.
- Deploys and rolls back changes for specific versions without needing to know what was already deployed.
- Deploy application and database changes together so they are always in sync.
More information at: https://www.liquibase.com/community
- macOS
- Windows
- Linux
brew install liquibase
First you need to install Windows Subsystem for Linux (WSL).
Follow the instructions at https://docs.microsoft.com/en-us/windows/wsl/install
- Download Liquibase:
- Go to the Liquibase releases page on GitHub: https://github.com/liquibase/liquibase/releases/latest.
- In the "Assets" section, download the
liquibase-${version}.zipfile.
- Extract the file:
- Unzip the ZIP file to a simple location, for example,
C:\liquibase.
- Unzip the ZIP file to a simple location, for example,
- Add to Windows PATH:
- Search for "Edit the system environment variables" in the Windows menu and click on "Environment Variables".
- In "System variables", select the Path variable and click "Edit".
- Add the path to your bin folder (e.g.
C:\liquibase\bin) to the end of the list, separated by a semicolon.
Linux is not officially supported at LATAM Airlines.
sudo snap install liquibase
liquibase --version