Archive for February, 2008

Tecuthsav’08 came to an END

Posted: February 18, 2008 in General

At last our tech fest the TecUthsav’08 came to an end today.The five days event has reached its end point today. Though the strength of the delegates who participated this time is less compared to Cyber it was successful.Its for the first time we conduct such a mega event in which all the departments of our college work together for a common symposium.Any way it was good experience. i was one of the event co-ordinators of Pradharsan(Paper presentation contest). The best paper award was banged by the students of MIT. Some third year girls helped us in screening the papers and thanks to those girls and to the whole pradharsan team

An unique contest of our department was “The Lord of the Rings” which is a five stage event.The first stage was Maze which was beautifully designed by our juniors.All other stages like Obfuscated code,google wars, programming in new language,code completion were also so challenging for the participants.Most of them felt that it was a different contest.Other contests were OLPC, Web designing,Tech-quiz and Walk the plank(Crypt-analysis).

Our Juniors played a huge part in this event and hats off to those guys and girls. Especially the decoration by the third year girls was splendid. They did every thing with lot of interest and eagerness.The kolam before the main-building and also the decoration in the octogon was so good.

Thanks to the sponsors TCS, CTS, Sun Microsystems, Motorola, Aricent and finally Radio Mirchi 🙂 The General secretaries, joint secretaries and also the treasurers worked hard to make it a success.

After the valedictory function of this technical festival we friends filled our tummies in Hotel Bell and had fun 🙂 It was memorable day

Admin Scripts in pgdb

Posted: February 6, 2008 in FOSS, Techstuff
Tags: , ,

In my project there was need for writing few admin scripts in python to create database account and database for a user.
In case of MySQL we connected to mysql database (admin database) and then performed the DDL queries like create database.The connection string we used is
conn=mysql.connect(host=”localhost”,user=”username”,passwd=” “,db=”mysql” )
.
It worked well.In the same way we wrote code for creating database in postgres is as follows:

import pgdb
conn=pgdb.connect(‘localhost:postgres:postgres:password’)
cursor=conn.cursor()
cursor.execute(‘create database test’)
cursor.close()
conn.close()

here postgres is the admin database.
But the create database didn’t work. The following error was thrown.

ERROR: CREATE DATABASE: May not be called in a transaction block

ie., we are not allowed to create database in the transaction block. Later found that doing a commit will end or close the current transaction and hence after a commit we performed create database.It worked then. In order to do that we just included a line

cursor.execute(‘COMMIT’)

before the line cursor.execute(‘create database test’)

Thus we can just do a commit before issuing any statements that PostgreSQL cannot execute within a transaction and perform such statements outside the transaction block.