Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bbpf=# create table foo(blah numeric);
- CREATE TABLE
- bbpf=# insert into foo(blah) values ('45.241654897');
- INSERT 0 1
- bbpf=# insert into foo(blah) values ('4445.25541654897');
- INSERT 0 1
- bbpf=#
- >>> import psycopg2
- >>> a=psycopg2.connect('host=127.0.0.1 dbname=bbpf user=jcigar password=xxxx')
- >>> a
- <connection object at 0x801196320; dsn: 'host=127.0.0.1 dbname=bbpf user=jcigar password=xxxxxxxxx', closed: 0>
- >>> curs = a.cursor()
- >>> curs.execute('select * from foo')
- >>> curs.fetchall()
- [(Decimal('45.241654897'),), (Decimal('4445.25541654897'),)]
- >>>
Add Comment
Please, Sign In to add comment