LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-07-2005, 01:37 AM   #1
anjani.78
Member
 
Registered: Mar 2005
Location: india
Distribution: debian , redhat
Posts: 30

Rep: Reputation: 15
Problem with Postgres Database Connection


Hello Everyone



I have one problem with a sofware (developed inhouse) running in client server mode. The source is written using Perl and Python. And as backend we are using Postgres database.



I have one server where Postgres database is available (say information about student)(Linux Environment) and a client(Windows environment) consisting a GUI where some programs are there which work according to the information that I pass as input and fetch the records from the server(from Postgres database) and generating PDF files as a result(say performance certificate, bonafide certificates). On client machine some compiled python files are available.



Problem is that when I execute the execuatable (GUI) from client machine it allows me to fetch data eg. Suppose I want to generate bonafide certificate of some student I have to give roll number say 2004101 as input in the text box , when I press tab key it fetches the data related to the number inputted, if data is available it displays it in non modifiable text boxes. Then to generate bonafide certificate I have to press Generate Certificate button, it generates the bonafide certificate for the student. It's a PDF file (here I am using platypus library to get the result in PDF file)


Now second case, I have another option to print Performance certificate (say grade sheet, semester wise or complete) for some student I have to apply same process as above by selecting the appropriate menu option for Performance certificate. But while I press the generate certificate button it gives programmer defined error "Can not generate certificate" and in error log file it gives me error "Connection failed in Perf_getRecords msg; Error: Current transaction is aborted, commands ignored until end of transaction block". Initially I thought is problem of TCP ip connection but as it is getting connected with the database it should only execute the query written in getRecords function. For this matter I checked the configuration files used for Postgres database (ie pg_hba.conf, postgresql.conf, pg_ident.conf)

Can you suggest some solution to me for this problem


I am giving so some part of the source code available in python file





#this function is used to get the performance records for a student


#input is the student roll number and a between clause (if certificate is year or sem wise )


#returns None on faliure and returns a sequence of PgResultSets on success


def __getRecords(rollno,betClause):


recs=None






#open the database connection


try:


con=PgSQL.connecthost=" 192.9.150.16", port=5432 ,database="dims",user="officer", password="indiaisgreat" )


except Exception,e:


writeError(" Connection failed in perf.__getRecords msg : %s" %str(e))


return None


else:



. . . . . . . . . . . . . . . . . .



Thanks in advance
 
Old 10-07-2005, 02:06 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Done some googling for you because I like Postgres a lot :}

http://www.open-xchange.org/pipermai...er/042937.html

Could you be facing similar problems?


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
create table in postgres database kranti Linux - Newbie 1 11-15-2005 06:52 PM
changing password for postgres database anjani.78 Linux - Software 1 07-18-2005 10:58 PM
Snort database: Closing connection to database "" Homer Glemkin Linux - Security 2 07-14-2005 06:58 PM
Connecting a Postgres Database from a Java application Paulo Góes Programming 4 08-23-2003 10:08 AM
Database connection Cyth Programming 2 12-23-2001 05:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration