Questions tagged [pgdb]
19 questions
7
votes
2 answers
Installing pgdb: pg_config tool is not available
So here is my goal: To get a .py file that imports pgdb, to run.
For this, as far as I have understood, I need PygreSql.
I have both postgresql 9.4.4 and python 2.7.9 installed (Postgresql with source code and python with the normal download form…

Sahand
- 7,980
- 23
- 69
- 137
5
votes
1 answer
How to use pgdb.executemany?
I'm trying to execute insert statements from Python to PostgreSQL using the pgdb module.
I see the documentation says:
cursor.executemany(query, list of params)
# Execute a query many times, binding each param dictionary
# from the…

Eric Wilson
- 57,719
- 77
- 200
- 270
4
votes
1 answer
pg.InternalError: SSL SYSCALL error: EOF detected
I have a code in python using multiprocessing and accessing a database. It works most of the time properly but from time to time it creates an error. The error was originally
File "/usr/lib/python2.7/multiprocessing/pool.py", line 528, in get
…

Antonin
- 1,748
- 7
- 19
- 24
2
votes
2 answers
python pgdb hanging database
I'm writing a script to access data in an established database and unfortunately, I'm breaking the DB. I'm able to recreate the issue from the command line:
[user@box tmp]# python
Python 2.7.2 (default, Sep 19 2011, 15:02:41)
[GCC…

fredsnertz
- 453
- 1
- 4
- 6
2
votes
1 answer
python insert to postgres over psycopg2 unicode characters
Hi guys I am having a problem with inserting utf-8 unicode character to my database.
The unicode that I get from my form is u'AJDUK MARKO\u010d'. Next step is to decode it to utf-8. value.encode('utf-8') then I get a string 'AJDUK…

HateCamel
- 23
- 1
- 6
1
vote
0 answers
Unable to insert data insert data in postgres table using pgdb
I am trying to insert some values in a postgres table in a python script using pgdb.
At first I tried this:
cursor.execute('INSERT INTO sites (url) VALUES (%s)', (i,))
This did not work so I changed it to
print 'INSERT INTO sites (url) VALUES…

Ravi
- 727
- 6
- 19
1
vote
2 answers
AttributeError: 'module' object has no attribute 'connect' in the pgdb module using python
import pgdb
myConnection = pgdb.connect( host=hostname, user=username, password=password, database=database )
doQuery( myConnection )
myConnection.close()
I get the following error when i run the script.
>>> AttributeError: 'module'…

sham sar
- 45
- 1
- 7
1
vote
0 answers
Error with using PyGreSQL. pg.DatabaseError: Last query did not return tuples
I use pgdb(PyGreSQL) in my project to connect to the working DB.
I wrote generator to fetch rows with the pagination from huge tables.
# DbHelper.py
...
def GetMultipleRowsGenerator(self, query, page_size=None):
"""Execute a query and return…

Stan Zeez
- 1,138
- 2
- 16
- 38
1
vote
1 answer
Does pgdb prevent against injection attacks?
I have a piece of code like this:
db = pgdb.connect(
database=connection['database'],
user=connection['user'],
host=connection['host'])
cursor = db.cursor()
# ask database
query = '''
SELECT a, b, c
FROM table
WHERE a ILIKE…

Ann Kilzer
- 1,266
- 3
- 16
- 39
0
votes
2 answers
Creating a user login function for a database in SQL using Python, pgdb, PostgreSQL
I have an SQL database that I access using Python and pgdb. I plan on opening access to a group of users, so I would like to incorporate a login function that takes in a username and password that is checked against the database's information on…

Captain Murphy
- 855
- 3
- 15
- 23
0
votes
0 answers
Right way to pass SQL to pgdb in python
Using pgdb connection I am passing SQL to get results into a DF which are further processed. As the module grows, python class (queries.py below) that keeps track of all the SQL is growing longer and longer. Any suggestions how to handle it as it…

SaM
- 43
- 7
0
votes
1 answer
pgdb import error (_pd.pyd file not created)
Facing the same issue as ver.2 PyGreSQL ERROR: from _pg import * ImportError: DLL load failed: The specified module could not be found, but in this case I can see that _pg.pyd file is not created in the site packages of the virtual environment.…

Peter Mølgaard Pallesen
- 1,470
- 1
- 15
- 26
0
votes
0 answers
OperationalError: Can't start transaction Postgresql
I am running pgdb.connect to make a connection to my postgresql server and cursor to execute queries. For the first time (sometimes twice) it works properly but after that it gives me
OperationalError: Can't start transaction
on…

bazinga
- 2,120
- 4
- 21
- 35
0
votes
1 answer
How to receive notices with PyGreSQL?
I'm using PyGreSQL 4.1.1 with Postgres 9.5, and have written some stored functions. I use RAISE with different levels inside of the functions for debugging purposes, which works very well in psql, but I haven't found a way to access those messages…

clemens
- 16,716
- 11
- 50
- 65
0
votes
1 answer
Finding a python module version gives error on production box but not my dev machine
I have the pgdb module installed on my MacOsX development box, my code works (specifically a line that is pgdb.connect(etc..) works great. I runt his code on my main server (linux) and it it says module has no attribute connect.
I think it is a…

Codejoy
- 3,722
- 13
- 59
- 99