🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › Data Management / Database Administration › PostgreSQL Administration › Lesson 1
TEC-DATA86-03 · Lesson 1 · 12 clock hours · lab

Server-Room Safety, PostgreSQL Architecture, and Installation on Linux

Objective. Students install PostgreSQL on a Linux server VM, verify the service is running, and identify physical and electrical hazards in a server-room environment.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

Server-Room Safety Before You Touch Anything

A server room is an electrical environment first and a computing environment second. Before you log in to a single terminal, you need to understand the physical hazards present and how to control them.

Electrical hazards. Server racks carry high-voltage AC power from PDUs (Power Distribution Units) and UPS (Uninterruptible Power Supply) systems. Locate the main electrical panel and any secondary breaker panels on your first walk-through. Never open a panel yourself unless you are a licensed electrician. If a device must be powered down for hardware work, follow your site's lockout/tagout (LOTO) procedure: de-energize the circuit, lock the breaker with your personal lock, and tag it before any hands-on work begins. This is an OSHA-recognized control for preventing unexpected re-energization.

Electrostatic discharge (ESD). Static electricity can destroy storage drives, RAM, and NIC cards instantly and silently. Any time you handle an exposed circuit board, RAM stick, drive, or NIC, put on an ESD wrist strap and connect it to the rack's grounding point before touching the component. Do not walk across carpet, then handle hardware without re-grounding.

Raised floors and cable management. Many data centers use raised-floor systems. Tiles can be removed for cabling and left open, creating fall hazards. Watch for open floor tiles, unsecured cable bundles, and sharp rack edges. Safety shoes with reinforced toes protect against dropped equipment—servers can weigh 30 lbs or more per rack unit.

Proper lifting. Use your legs, not your back. Keep the load close to your body. For equipment over roughly 35–40 lbs, use a two-person lift or a server-lift cart. Rack-mount rails should be fully extended and locked before sliding a server in or out.

Environmental awareness. Server rooms run cold (typically 65–75 °F) for equipment protection. Hot and cold aisles channel airflow; standing in a hot aisle for extended periods in front of exhaust can cause discomfort. Emergency exits, fire suppression system controls (often gaseous suppression—do not block the discharge nozzles), and eyewash stations should be identified on your walkthrough.

Complete every field on the signed safety log before beginning any hands-on lab work. Your instructor will not sign off on the lab without it.

---

PostgreSQL Architecture Overview

PostgreSQL is a multi-process relational database management system (RDBMS). Understanding its process model helps you diagnose problems, tune performance, and interpret log files.

The postmaster process is the parent of all other PostgreSQL processes. It listens for incoming client connections on a configured TCP port (default 5432) and forks a new backend worker process for each accepted connection. The backend worker handles SQL parsing, planning, and execution for that single client session. When the session ends, the backend exits.

Background worker processes handle essential ongoing tasks:

On-disk directory structure ($PGDATA).

`$PGDATA` is the root of the PostgreSQL data directory, set at `initdb` time (commonly `/var/lib/pgsql/<version>/data/` on RPM-based systems or `/var/lib/postgresql/<version>/main/` on Debian/Ubuntu). Inside you will find:

This entire directory must be owned by the `postgres` OS user, with permissions `700`. If any other user can read it, you have a security misconfiguration.

---

Installing PostgreSQL on Linux Using the PGDG Repository

The PostgreSQL Global Development Group (PGDG) maintains official package repositories for both RPM-based (Rocky Linux, RHEL, Fedora) and Debian-based (Ubuntu, Debian) distributions. Using the PGDG repo—rather than the distribution's default repo—gives you the current stable release and clean upgrade paths.

General steps (Rocky Linux example):

1. Install the PGDG RPM repo package for your OS version from [postgresql.org/download](https://www.postgresql.org/download/).

2. Disable the built-in PostgreSQL module so it does not conflict: `sudo dnf -qy module disable postgresql`.

3. Install the server package: `sudo dnf install -y postgresql16-server`.

4. Initialize the data directory: `sudo /usr/pgsql-16/bin/postgresql-16-setup initdb`.

5. Enable and start the service: `sudo systemctl enable --now postgresql-16`.

Verifying the service. Run `systemctl status postgresql-16` and confirm `Active: active (running)`. Check that `$PGDATA` is owned by `postgres:postgres` with permissions `drwx------` using `ls -ld $PGDATA`.

Service control commands. You can manage the service two ways. `systemctl` is the standard systemd interface (`start`, `stop`, `restart`, `reload`). `pg_ctl` is PostgreSQL's own utility and gives you finer control—useful for scripting or when systemd is not available (`pg_ctl start -D $PGDATA`, `pg_ctl reload -D $PGDATA`).

Capture all terminal output as evidence for your lab submission.

Key terms10

PostmasterThe parent PostgreSQL process that listens for client connections and forks a new backend worker process for each accepted connection.
WAL (Write-Ahead Log)A sequential log of all changes written to disk before the corresponding data pages are modified, ensuring durability and enabling crash recovery.
CheckpointerA PostgreSQL background process that writes dirty shared-buffer pages to data files at regular intervals, establishing a safe recovery point.
AutovacuumA PostgreSQL subsystem that automatically runs VACUUM and ANALYZE on tables to reclaim dead-row space and keep planner statistics current.
$PGDATAThe environment variable pointing to the PostgreSQL data directory, which contains configuration files, WAL segments, and the base subdirectory for all database files.
ESD Wrist StrapA personal protective device that grounds the wearer to a rack or work surface, preventing electrostatic discharge from damaging sensitive electronic components.
Lockout/Tagout (LOTO)An OSHA-recognized safety procedure for de-energizing electrical equipment, locking the energy-isolation point with a personal lock, and tagging it before performing hands-on maintenance.
PGDG RepositoryThe official package repository maintained by the PostgreSQL Global Development Group, providing current stable PostgreSQL releases for major Linux distributions.
pg_ctlPostgreSQL's own command-line utility for initializing, starting, stopping, and reloading a PostgreSQL server instance, independent of the OS init system.
pg_hba.confThe PostgreSQL host-based authentication configuration file that controls which users can connect from which hosts and which authentication method is required.
In class: Complete a server-room safety walkthrough checklist covering electrical panel locations, raised-floor trip hazards, proper lifting technique for equipment, and recognition of when PPE (ESD wrist strap, safety shoes) is required; record findings in a signed safety log. · Use the PostgreSQL global development group (PGDG) repository to install a current stable PostgreSQL release on a Rocky Linux or Ubuntu VM, then start, stop, and reload the service using both pg_ctl and systemctl, capturing terminal output as evidence. · Draw a labeled architecture diagram showing the PostgreSQL process model (postmaster, backend worker, WAL writer, checkpointer, autovacuum launcher) and the major on-disk directory structure ($PGDATA, pg_wal, pg_base), then explain each component to a partner.
Materials: Linux VM (VirtualBox or cloud sandbox), PGDG repository docs, postgresql.org installation guide, ESD wrist straps, server-room safety checklist handout, PostgreSQL 16 Documentation Chapter 18 (Server Setup and Operation)
Check: Instructor verifies service is active (systemctl status), correct data-directory ownership (postgres user), and completed safety checklist with all fields signed; pass = service running AND checklist 100% complete.

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

Workplace safety / physical environment
1. Which action must be completed FIRST before a technician opens a breaker panel in a server room to work on a circuit?
Workplace safety / physical environment
2. An ESD wrist strap is required when performing which of the following tasks?
PostgreSQL architecture and administration
3. Which PostgreSQL background process is responsible for flushing Write-Ahead Log records from shared memory to the pg_wal directory?
PostgreSQL installation and service management
4. After installing PostgreSQL from the PGDG repository on Rocky Linux, which command correctly verifies that the service is active and running?
PostgreSQL security and server configuration
5. What is the correct ownership and permission setting for the PostgreSQL $PGDATA directory?
PostgreSQL security and server configuration
6. Which file inside $PGDATA controls which clients are allowed to connect to PostgreSQL and what authentication method each must use?
PostgreSQL installation and service management
7. A technician needs to apply a configuration change to postgresql.conf without disconnecting active client sessions. Which command achieves this?
PostgreSQL architecture and administration
8. Which PostgreSQL process is the parent of all other PostgreSQL processes and is responsible for accepting incoming client connections?
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.