Thursday, February 14, 2008

To kill the postgresql database

	ERROR:  database is being accessed by other users

If you get this error, you can kill the particular database using following command.

kill `ps auxww | grep 'postgres: username databasename' |grep -v 'grep' |awk '{ print $2 }'`

1 comment:

Prasath R said...

Integrating Perl with PHP

Yes, it is possible to integrate Perl Interpreter with PHP script. Perl and PHP are very popular web programming Language. Both the interpreter are developed in C language libraries.

Before Integrating make sure that you must install PHP and Perl language.

To check that, open the terminal,

shell> perl -v

It will check the Perl language version along with Perl description and copyright. Likewise,

shell> php -v

It will show the PHP language version along with Copyright and zend technologies group.

For integrating , you must install the PHP Perl extension package. You can download this PHP Perl extension package from this link,

Follow the steps given in README file in the downloaded package.

Through Perl extension package, the programmer can

* load and execute perl files
* evaluate perl code
* access perl variables
* call perl functions
* instantiate perl objects
* access properties of perl objects
* call methods of perl objects

These features can be accessible only through API class called Perl().

For Example test.php :

echo "first line";
$perl_obj = new Perl(); // Creating a object called $perl_obj for the class Perl()
$perl_obj->require(""); // Perl files can be loaded through Perl::require module.
echo "last line";

For more details,

R. Prasath