Posts

Showing posts from May, 2011

Remote Log Reading in PostgreSQL 8.4 and 9.0.

I was going through the one of the important feature (SQL/MED) which is coming feature of PostgreSQL 9.1. This feature enables user to access any external file, using SQL, from PostgreSQL Terminal. Magnus hagander's has also blogged about this feature and he has shown "How to access the PostgreSQL logfile using SQL/Med" . After going through his blog, I thought to do same with PostgreSQL 8.4/9.0 using plperl program. Following are the steps, which can be use to access the postgreSQL csv log file: 1. Change the log_destination parameter in postgresql.conf file of PG Instance Directory, to create csvlog of postgreSQL log. As given below. log_destination = 'stderr,csvlog' 2. Reload the changes in PostgreSQL, using following command: postgres=# select pg_reload_conf(); pg_reload_conf ---------------- t (1 row) 3. Connect to PostgreSQL database using psql command and Create following data type CREATE type pg_log_type as ( log_time timestamp(3) with ti

PostgreSQL Database Link to Oracle Database on Linux

I have seen question, like "How to make Database Link from PostgreSQL to Oracle?", always floats in PostgreSQL Community Forum. So, I thought to do some research on it and write a Blog. Cybertec (One of The PostgreSQL Database Company) has released a PostgreSQL Module ODBC Link, using which user can make Database link to any other database, including Oracle, MS SQL Server, PostgreSQL etc, which have ODBC compliant Data source. Lets see how you can make ODBC Connection from PostgreSQL to any ODBC compliant data source and fetch data. Installation of this module is very simple. Following are the steps which user can follow: 1. Install the unixODBC driver on your linux machine. user can use following useful link for Downloading and Installing the unixODBC Driver: http://www.unixodbc.org/ 2. Download ODBC-Link from following location: http://www.cybertec.at/download/odbc_link/ODBC-Link-1.0.4.tar.gz 3. Untar the downloaded file as given below: tar -zxvf ODBC-Link-1.0.4.

First Interaction with NOSQL Database (MongoDB)

I heard a lot about NoSQL Databases. So, I thought to try out this database. I found it simple to use and easy to configure. To Download MongoDB, user can use following link: http://www.mongodb.org/downloads Installation is easy. If you are planning to use pre-built binaries, then you can untar the binaries and can start using it. To start. First Create a data directory as given below: mkdir -p mongodb/data Initialize the Mongodb as given below: "MongoDB Installation Directory"/bin/mongod --dbpath mongodb/data --logpath mongodb.log Default port on which MonogoDB runs is 27017 To Connect with MongoDB instance, user can use following command: ./mongo 127.0.0.1:27017/foo Or you can use following options: usage: ./mongo [options] [db address] [file names (ending in .js)] db address can be: foo foo database on local machine 192.169.0.5/foo foo database on 192.168.0.5 machine 192.169.0.5:9999/foo foo database on 192.168.0.5 machine on p