Quick Start¶
Get up and running with pg in 5 minutes!
1. Install pg¶
Install from packages (recommended)¶
RPM (Fedora/RHEL/CentOS):
# Download and install
curl -L "https://gitlab.com/l_avrot/pg-lord-of-the-rings/-/packages/generic/pglord/v1.1/pglord-1.1-1.fc41.noarch.rpm" -o pglord.rpm
sudo dnf install ./pglord.rpm
DEB (Debian/Ubuntu):
# Download and install
curl -L "https://gitlab.com/l_avrot/pg-lord-of-the-rings/-/packages/generic/pglord/v1.1/pglord_1.1-1_all.deb" -o pglord.deb
sudo dpkg -i pglord.deb
See the Installation page for other ways to install.
2. Set Up Service File (Recommended)¶
Create ~/.pg_service.conf:
[dev]
host=localhost
port=5432
user=myuser
dbname=myapp
[production]
host=prod-db.company.com
port=5432
user=app_user
dbname=myapp
sslmode=require
Why Service Files?
Service files keep credentials secure, commands clean, and make environment switching trivial.
3. Your First Commands¶
Connect to your database:
Export a database:
Create a new database:
Check server status:
4. Alternative Connection Methods¶
If you prefer individual flags:
Or use a connection string:
5. Get Help Anytime¶
pg help # Full command reference
pg dump --help # Help for dump command
pg query --pg-verbose # Debug mode for troubleshooting
pg dump db --help # Help for the underlying Postgres tool (here pg_dump)
man pg # Complete manual page
What's Next?¶
- Connection Options - Master all connection methods
- Command Examples - Real-world usage patterns
- Command Reference - Complete command list
🎉 You're ready to go! Start with pg query and explore from there.