Skip to Content

David Cao

David is a Cloud & DevOps Enthusiast. He has years of experience as a Linux engineer. He had working experience in AMD, EMC. He likes Linux, Python, bash, and more. He is a technical blogger and a Software Engineer. He enjoys sharing his learning and contributing to open-source.

The error “could not load server certificate file ‘server.crt’: No such file or directory” in PostgreSQL indicates that the server is unable to find the server.crt file, which is required for SSL connections. If you don’t need that, set “ssl = off”, then PostgreSQL won’t complain. If you want transport encryption with TLS, you have …

Read More about 2 ways to fix could not load server certificate file ‘server.crt’: No such file or directory in PostgreSQL

Enabling SSL in PostgreSQL is a straightforward process that only requires three simple steps: Make sure we have the server certificate and key files available Enable the SSL configuration (ssl = on) Make sure the pg_hba.conf file rules are updated accordingly   Obtain server certificate and key files for Postgres On PostgreSQL server, we need …

Read More about Enable SSL in Postgresql

When running the \dt command in PostgreSQL, the error message “Did not find any relations” means that no tables were found in the current schema that is visible to the user running the command. In PostgreSQL, the \dt command is used to list all the tables in the current schema. If the command is executed …

Read More about 3 ways to fix Did not find any relations in Postgresql

Get table size with pg_relation_size in Postgres PostgreSQL provides a dedicated function, pg_relation_size, to compute the actual disk space used by a specific table or index. We just need to provide the table name. To check the size of a table in a PostgreSQL database, you can use the following SQL query: select pg_size_pretty(pg_relation_size(‘table_name’)); Replace …

Read More about 3 ways to get table size in Postgres

Some tasks may consume a significant amount of system resources, such as CPU or memory, and running too many of these tasks at once can cause performance issues. By adding a pause between loop iterations, you can help to manage resource consumption and prevent performance issues. It can help to avoid overwhelming the target system …

Read More about Ansible: Loop over items with a pause between iterations

selectattr in Ansible selectattr is a filter plugin in Ansible that allows you to select a subset of elements from a list of dictionaries based on the value of a particular attribute.  Its syntax is as follows: <list of dictionaries> | selectattr(‘<attribute>’, ‘<operator>’, ‘<value>’)   Key Description list_of_dictionaries A list of dictionaries representing items to …

Read More about selectattr in Ansible