[PyGreSQL] simple .insert example?
Tim Callaghan
tmcallaghan at gmail.com
Wed Sep 16 09:29:52 EDT 2009
Need help. I'm trying to do a simple insert and want to use the
.insert so I get back my bigserial column, table definition is as
follows:
create table t_job
(job_pk bigserial primary key,
job_id varchar(50) not null unique,
job_name varchar(50) not null);
here is my current python, when I run it I'm getting "AttributeError:
insert" (if i do a .query with an insert command it works fine):
import pg
db = pg.connect('testdb','localhost',-1,None,None,'testuser','testpw')
dictDB = {}
updValues = {'job_id':'job-id-0001', 'job_name':'job-name-0001'}
print db.insert(t_job',dictDB,updValues)
print dictDB
Any help would be greatly appreciated.
-Tim
More information about the PyGreSQL
mailing list