Technology Insights

PostgreSQL: Run A SELECT Statement From A Linux Shell Using PSQL

Earlier today I was troubleshooting some resource issues on a PostgreSQL server and needed to test some various SELECT statements to see if any of them were causing problems. I also wanted to verify the amount of resources a SELECT statement made using PGAdmin versus the amount of resources the same SELECT statement used running it directly on the Postgres server itself. Below is information on how to run a SELECT statement from a Linux shell. In this example the server is running CentOS Linux and PostgreSQL 8.4.4.

Technology Insights

Modify Every Row In A MySQL Table By Adding Data To The Front Of Each Column

Last night I was working on a project for a customer where the application was going to reference external images after the changes I made. One of the custom parts of the project included modifying the thousands of rows that currently existed in the MySQL database. I needed away to modify one of the columns in a MySQL database table by adding data to the front of that column in each row.

Technology Insights

PostgreSQL Log Entries: CDTLOG: statement: SHOW client_min_messages

I was troubleshooting an issue at work the other day regarding some PostgreSQL connections that were not closing. They were left IDLE, never closed, and eventually used up all of the possible connections (which totaled 100) configured in the  postgresql.conf configuration file. In the process of troubleshooting I noticed a bunch of Postgres log entries that I was unable to immediately pin down to what was causing the entries. Below I describe the view of the idle Postgres connections, the PostgreSQL log entries that were unfamiliar, and the cause of both.