This project is archived and is in readonly mode.

#227 ✓invalid
matheus

'with' statment not working in tornado

Reported by matheus | August 13th, 2014 @ 04:25 PM

Transaction isn't rolling back in case of error. Please check the file attached.

how to reprocude error:

run the tornado instance;
access localhost:8080/signup/create;
make a POST request with an empty value for one of the dates;

The exception raised will be:
psycopg2.DataError: invalid input syntax for type date

Error after trying to access the same page:
psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block

python version = 3.4.1
psycopg2 version = 2.5.3
tornado version = 4.0

table users:
Table "public.users" Column | Type | Modifiers ---------------+--------------------------+----------- user_id | integer | first_name | character varying(20) | last_name | character varying(40) | nick_name | character varying(20) | gender | character(1) | birth_date | date | not null country_id | character(2) | created_date | timestamp with time zone | not null news | boolean | last_mod_date | timestamp with time zone | not null Check constraints:
"users_gender_check" CHECK (gender = ANY (ARRAY['m'::bpchar, 'f'::bpchar])) Foreign-key constraints:
"users_country_id_fkey" FOREIGN KEY (country_id) REFERENCES countries(country_id) "users_user_id_fkey" FOREIGN KEY (user_id) REFERENCES credentials(user_id) Disabled triggers:
update_users_date AFTER UPDATE ON users FOR EACH ROW EXECUTE PROCEDURE update_mod_date()

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins

Attachments

Pages