0
0
PostgreSQLquery~20 mins

PostgreSQL installation and setup - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
PostgreSQL Setup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding PostgreSQL Service Status
After installing PostgreSQL on a Linux system, which command correctly checks if the PostgreSQL service is running?
Apg_ctl check
Bpsql --status
Cservice postgresql start
Dsystemctl status postgresql
Attempts:
2 left
💡 Hint
Think about how services are managed on modern Linux systems.
query_result
intermediate
1:30remaining
Default PostgreSQL Port Number
What is the default port number PostgreSQL listens on after installation?
A5432
B3306
C1521
D8080
Attempts:
2 left
💡 Hint
This port is commonly used by PostgreSQL worldwide.
📝 Syntax
advanced
2:30remaining
Correct Command to Initialize a New PostgreSQL Database Cluster
Which of the following commands correctly initializes a new PostgreSQL database cluster on a Linux system?
Apg_init -D /var/lib/postgresql/data
Binitdb -D /var/lib/postgresql/data
Ccreatedb -D /var/lib/postgresql/data
Dpg_createcluster -D /var/lib/postgresql/data
Attempts:
2 left
💡 Hint
The command name starts with 'init'.
🔧 Debug
advanced
3:00remaining
Troubleshooting PostgreSQL Connection Refused Error
After installing PostgreSQL and starting the service, a user tries to connect with 'psql' but gets 'connection refused'. Which is the most likely cause?
AThe 'psql' command is misspelled
BThe PostgreSQL data directory is empty
CPostgreSQL is not listening on the expected port or address
DThe database user password is incorrect
Attempts:
2 left
💡 Hint
Connection refused means the server is not accepting connections on the network.
optimization
expert
4:00remaining
Optimizing PostgreSQL Startup Performance
Which configuration change can improve PostgreSQL startup time after installation on a server with limited memory?
AReduce 'shared_buffers' size to a smaller value
BSet 'work_mem' to a very large value
CEnable 'fsync' to off
DIncrease 'max_connections' to a very high number
Attempts:
2 left
💡 Hint
Startup time can be affected by memory allocation settings.