Hello,
My code seems to operating fine, loading some values into a Postgres
8.1 database using sqlalchemy 0.4.7 in Debian Lenny. The first 2
tables load fine into Postgres, but on the third looking at the logs
(see below), something strange happens. sqlalchemy passes in the
column values correctly, but after the second column in the third
table, Postgres commits the values as 'None'. All tables after this
one also fail to load values, but the tables/columns are set up
properly as far as structure. Just no data. It almost seems like
Postgres ran out of buffer memory or something after a certain point.
Log lines of interest with comments inserted:
#Table set up correctly, converting to Postgres types
2009-05-18 11:19:11,751 INFO sqlalchemy.engine.base.Engine.0x..ac
CREATE TABLE person (
id SERIAL NOT NULL,
person_id VARCHAR(50),
person_id_date_collected TIMESTAMP WITH TIME ZONE,
date_of_birth DATE,
date_of_birth_date_collected TIMESTAMP WITH TIME ZONE,
ethnicity INTEGER,
ethnicity_date_collected TIMESTAMP WITH TIME ZONE,
gender INTEGER,
gender_date_collected TIMESTAMP WITH TIME ZONE,
legal_first_name VARCHAR(50),
legal_first_name_date_collected TIMESTAMP WITH TIME ZONE,
legal_last_name VARCHAR(50),
legal_last_name_date_collected TIMESTAMP WITH TIME ZONE,
legal_middle_name VARCHAR(50),
legal_middle_name_date_collected TIMESTAMP WITH TIME ZONE,
legal_suffix VARCHAR(50),
legal_suffix_date_collected TIMESTAMP WITH TIME ZONE,
social_security_number VARCHAR(9),
social_security_number_date_collected TIMESTAMP WITH TIME ZONE,
social_security_number_quality_code VARCHAR(2),
social_security_number_quality_code_date_collected TIMESTAMP WITH
TIME ZONE,
PRIMARY KEY (id)
)
#all the data values passed in correctly by sqlalchemy:
2009-05-18 11:19:12,315 INFO sqlalchemy.engine.base.Engine.0x..ac
COMMIT
{'person_date_of_birth': '1999-01-22', 'person_legal_last_name':
'Washington', 'person_id_date_collected': datetime.datetime(2004, 8,
1, 0, 0), 'person_legal_middle_name_date_collected': datetime.datetime
(2004, 8, 1, 0, 0), 'person_legal_suffix_date_collected':
datetime.datetime(2004, 8, 1, 0, 0), 'person_legal_suffix': 'Jr.',
'person_legal_middle_name': 'Michael', 'person_gender_date_collected':
datetime.datetime(2004, 8, 1, 0, 0),
'person_date_of_birth_date_collected': datetime.datetime(2004, 8, 1,
0, 0), 'person_legal_first_name': 'George', 'person_id': 'DCF017Y0',
'person_legal_first_name_date_collected': datetime.datetime(2004, 8,
1, 0, 0), 'person_legal_last_name_date_collected': datetime.datetime
(2004, 8, 1, 0, 0), 'person_ethnicity_date_collected':
datetime.datetime(2004, 8, 1, 0, 0), 'person_ethnicity': '0',
'person_gender': '1'}
2009-05-18 11:19:12,356 DEBUG sqlalchemy.orm.unitofwork.UOWTransaction.
0x..2c register object for flush: per...@0x874364c isdelete=False
listonly=False postupdate=False
2009-05-18 11:19:12,369 DEBUG sqlalchemy.orm.unitofwork.UOWTransaction.
0x..2c Dependent tuples:
2009-05-18 11:19:12,371 DEBUG sqlalchemy.orm.unitofwork.UOWTransaction.
0x..2c Dependency sort:
[UOWTask(0x87434ec) Mapper: 'Person/person']
2009-05-18 11:19:12,373 INFO sqlalchemy.orm.unitofwork.UOWTransaction.
0x..2c Task dump:
UOWTask(0x87434ec, Person/person/None) (save/update phase)
+-Save per...@0x874364c
UOWTask(0x87434ec, Person/person/None) (delete phase)
2009-05-18 11:19:12,375 INFO sqlalchemy.engine.base.Engine.0x..ac
BEGIN
2009-05-18 11:19:12,383 INFO sqlalchemy.engine.base.Engine.0x..ac
select nextval('"person_id_seq"')
2009-05-18 11:19:12,387 INFO sqlalchemy.engine.base.Engine.0x..ac None
2009-05-18 11:19:12,389 INFO sqlalchemy.engine.base.Engine.0x..ac
INSERT INTO person (id, person_id, person_id_date_collected,
date_of_birth, date_of_birth_date_collected, ethnicity,
ethnicity_date_collected, gender, gender_date_collected,
legal_first_name, legal_first_name_date_collected, legal_last_name,
legal_last_name_date_collected, legal_middle_name,
legal_middle_name_date_collected, legal_suffix,
legal_suffix_date_collected, social_security_number,
social_security_number_date_collected,
social_security_number_quality_code,
social_security_number_quality_code_date_collected) VALUES (%(id)s, %
(person_id)s, %(person_id_date_collected)s, %(date_of_birth)s, %
(date_of_birth_date_collected)s, %(ethnicity)s, %
(ethnicity_date_collected)s, %(gender)s, %(gender_date_collected)s, %
(legal_first_name)s, %(legal_first_name_date_collected)s, %
(legal_last_name)s, %(legal_last_name_date_collected)s, %
(legal_middle_name)s, %(legal_middle_name_date_collected)s, %
(legal_suffix)s, %(legal_suffix_date_collected)s, %
(social_security_number)s, %(social_security_number_date_collected)s, %
(social_security_number_quality_code)s, %
(social_security_number_quality_code_date_collected)s)
#And here is where most of the data is changed to "None", which is my
problem. The first three columns (id, person_id, and
person_id_date_collected are committed fine and show up in the db.
The rest are 'None':
2009-05-18 11:19:12,389 INFO
sqlalchemy.engine.base.Engine.0x..ac {'legal_middle_name': None,
'gender': None, 'legal_first_name_date_collected': None,
'legal_last_name': None, 'person_id_date_collected': datetime.datetime
(2004, 8, 1, 0, 0),
'social_security_number_quality_code_date_collected': None,
'legal_suffix_date_collected': None, 'id': 1L,
'legal_middle_name_date_collected': None, 'date_of_birth': None,
'gender_date_collected': None,
'social_security_number_date_collected': None,
'social_security_number_quality_code': None,
'ethnicity_date_collected': None, 'date_of_birth_date_collected':
None, 'person_id': 'DCF017Y0', 'social_security_number': None,
'legal_last_name_date_collected': None, 'legal_suffix': None,
'legal_first_name': None, 'ethnicity': None}
2009-05-18 11:19:12,416 INFO sqlalchemy.orm.unitofwork.UOWTransaction.
0x..2c Execute Complete
Any ideas on how to fix this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---