PostgreSQL is a powerful, open-source object-relational database system that has earned a strong reputation for reliability, feature robustness, and performance. It is known for its advanced features, extensibility, and standards compliance.
- Introduction - Basic concepts and getting started
- Install PostgreSQL - Install PostgreSQL in RHEL 8
- Replication PostgreSQL - Configure Replica
- SQL - SQL commands and examples
- DB script - Database scripts and utilities
- Pg Parameters - PostgreSQL configuration parameters
- PostgreSql OS User_change - OS user management
- fail2ban Configure - Security and fail2ban setup
- Run SQL command from another OS user - Running psql as different users
- PostgreSQL DBA Cheat Sheet - Essential Functions & Commands
- ACID Compliance: Ensures data integrity and reliability
- Complex Queries: Support for complex SQL queries and advanced data types
- Multi-Version Concurrency Control (MVCC): Enables concurrent access to data
- Point-in-Time Recovery: Allows recovery to any point in time
- Table Partitioning: Efficient handling of large tables
- JSON Support: Native JSON and JSONB data types
- Full-Text Search: Advanced text search capabilities
- Geographic Objects: PostGIS extension for geographic data
- Extensibility: Custom functions, operators, and data types
- Replication: Built-in replication for high availability
- Security: Row-level security and encryption
- Download the installer from PostgreSQL Official Website
- Run the installer and follow the setup wizard
- Remember the password you set for the postgres user
- The default port is 5432
- Optional: Install pgAdmin (GUI tool) during installation
sudo apt update
sudo apt install postgresql postgresql-contribbrew install postgresql- PostgreSQL service starts automatically after installation
- To manage service: Services app → PostgreSQL
- Default data directory:
C:\Program Files\PostgreSQL\[version]\data
sudo service postgresql start
# or
sudo systemctl start postgresqlbrew services start postgresql# Connect as postgres user
psql -U postgres
# Connect to specific database
psql -U postgres -d database_name
# Connect with host and port
psql -h localhost -p 5432 -U postgres-- List all databases
\l
-- Connect to a database
\c database_name
-- List all tables
\dt
-- Describe a table
\d table_name
-- Exit psql
\qpostgresql.conf: Main configuration filepg_hba.conf: Client authentication configurationpg_ident.conf: User name mapping
max_connections: Maximum number of concurrent connectionsshared_buffers: Memory allocated for cachingwork_mem: Memory for sorting and joinsmaintenance_work_mem: Memory for maintenance operations
For detailed security configuration and fail2ban setup, refer to:
- fail2ban.md - Security setup guide
- run_psql_other_user.md - User management
- PostgreSql_OS_User_change.md - OS user configuration
- Official Documentation
- PostgreSQL Tutorial
- Stack Overflow PostgreSQL Tag
- PostgreSQL Wiki
- PostgreSQL Exercises
Feel free to contribute to this repository by:
- Forking the repository
- Creating a new branch
- Making your changes
- Submitting a pull request
This project is licensed under the MIT License - see the LICENSE file for details.