From: | Ricardo Caesar Lenzi <ricardo(at)k1(dot)com(dot)br> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | |
Date: | 2001-09-26 15:32:15 |
Message-ID: | 20010926123215.79f01f42.ricardo@k1.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================
Your name : Ricardo Caesar Lenzi
Your email address : ricardo(at)k1(dot)com(dot)br
System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel Pentium
Operating System (example: Linux 2.0.26 ELF) : Linux 2.2.16 (Conectiva Linux)
PostgreSQL version (example: PostgreSQL-7.1.1): PostgreSQL-7.2devel
Compiler used (example: gcc 2.95.2) : 2.91.66
Please enter a FULL description of your problem:
------------------------------------------------
All the postgres functions, when using python interface, returns values
in wrong data type, text instead integer or float.
Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
Table structure:
ricardo=# \d contato
Table "contato"
Column | Type | Modifiers
------------+---------+-------------------------------------
id_contato | integer | default nextval('contato_id'::text)
nome | text |
fone1 | text |
fone2 | text |
email | text |
Indexes: contato_ix1,
contato_ix2
Python program, using postgresql-7.1.3 server:
[ricardo(at)ricardo ricardo]$ python
Python 1.5.2 (#1, Jun 18 2000, 03:54:39) [GCC egcs-2.91.66 19990314/Linux]
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import pg
>>> db=pg.connect("ricardo")
>>> c=db.query("select count(*) from contato").getresult()[0][0]
>>> print repr(c), type(c)
'27' <type 'string'>
>>> c=db.query("select sum(id_contato) from contato").getresult()[0][0]
>>> print repr(c), type(c)
'475' <type 'string'>
>>> c=db.query("select nextval('contato_id')").getresult()[0][0]
>>> print repr(c), type(c)
'1' <type 'string'>
Python program, using postgresql-7.1.2 server:
[ricardo(at)ricardo ricardo]$ python
Python 1.5.2 (#1, Jun 18 2000, 03:54:39) [GCC egcs-2.91.66 19990314/Linux]
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import pg
>>> db=pg.connect("ricardo")
>>> c=db.query("select count(*) from contato").getresult()[0][0]
>>> print repr(c), type(c)
27 <type 'int'>
>>> c=db.query("select sum(id_contato) from contato").getresult()[0][0]
>>> print repr(c), type(c)
475 <type 'int'>
>>> c=db.query("select nextval('contato_id')").getresult()[0][0]
>>> print repr(c), type(c)
1 <type 'int'>
If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
--
From | Date | Subject | |
---|---|---|---|
Next Message | Mike Rogers | 2001-09-26 16:13:17 | PostgreSQL / PHP Overrun Error |
Previous Message | Łukasz Odziewa | 2001-09-25 19:53:21 | maybe a bug? |