Showing posts with label PostgreSQL. Show all posts
Showing posts with label PostgreSQL. Show all posts

2012-07-13

Scratch of the day - php throwing stricts error on browser

Today, I had to setup a Postgresql database server with phpPgAdmin web interface. While visiting the web interface for the first time, this error message appears on the top :







Strict Standards: Only variables should be assigned by reference in 
/usr/local/www/phpPgAdmin/classes/database/Connection.php on line 23

Warning: Cannot modify header information - headers already sent by 
(output started at /usr/local/www/phpPgAdmin/classes/database/Connection.php:23) 
in /usr/local/www/phpPgAdmin/classes/Misc.php on line 540

Seems like php 5.4.4 imposed some extra measure as best practice.

Although phpPgAdmin works as usual, the error message is annoying. Plus, it is kind of bad to show what potentially can be exploit.

To turn off these error messages, just tweak the below parameter in /usr/local/etc/php.ini :

2009-06-21

PostgreSQL - How to reset user name "postgres" password

PostgreSQL is an open source RDBMS (Relational DataBase Management System) that is not only feature rich, fast and light but also easy to use. Its documentation available at its website is a superb way of learning as well. Browsing the documentation and you will find that its way of explaining is no "bullshit" approach, short and concise.

After the initial installation, one might forget to set the password after running the initial script to setup the database. After a while, naturally, we all forget the password. Below are the steps to reset the password for user name "postgres" :

2009-05-04

PostgreSQL - pg_ctl: invalid data in PID file

One fine day, when restarting PostgreSQL :


/usr/local/etc/rc.d/postgresql restart
it complained that
pg_ctl: invalid data in PID file "/postgres/directory/postmaster.pid"

postmaster.pid was the process ID file for PostgreSQL, which indicate PostgreSQL process. If the file exists, it would mean that PostgreSQL is alive and running. If it doesn't, it would (of cause) mean PostgreSQL have been terminated, either on purpose or abnormally.

2009-02-26

Postgres SQL - passwordless login within bash script

Most of the time, we need to write a script to update multiple fields in a database table, pull values from database to fill up other tables or even grab from database and pass it to programs to process. The most annoying thing is every time it tries to connect to the database server, it prompts for password. Worse, if the sql statement in the bash script is not optimized or written properly, the scripts could actually ask for the password, more then 1 time !!!

Problem :

Connecting to postgresql (psql) within a bash script with no password,  preferred.


Solution :