Обсуждение: PyGreSQL v3.2 doesn't support INT8 types

Поиск
Список
Период
Сортировка

PyGreSQL v3.2 doesn't support INT8 types

От
Ricardo Caesar Lenzi
Дата:
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name        : RICARDO CAESAR LENZI
Your email address    : RICARDO@K1.COM.BR


System Configuration
---------------------
  Architecture (example: Intel Pentium)      : INTEL PENTIUM

  Operating System (example: Linux 2.0.26 ELF)     : LINUX 2.2.16

  PostgreSQL version (example: PostgreSQL-7.1.1): PostgreSQL-7.2devel

  Compiler used (example:  gcc 2.95.2)        : GCC 2.91.66


Please enter a FULL description of your problem:
------------------------------------------------

Python handle as string all int8 values from postgresql. This could be
view when using the aggregate function count() and function nextval
that returns an int8 value, but in python is represented like string:

>> db.query("select nextval('my_seq')").getresult()
[('2',)]

>> db.query("select count(*) from films").dictresult()
[{'count': '120'}]


Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

see previous.


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Patch the file src/interfaces/python/pgmodule.c with the
patch file attached in this mail.


Please commit this before the version 7.2.
Thanks and congratulations for the good job,
Ricardo.

Вложения

Re: PyGreSQL v3.2 doesn't support INT8 types

От
Bruce Momjian
Дата:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


> ============================================================================
>                         POSTGRESQL BUG REPORT TEMPLATE
> ============================================================================
>
>
> Your name        : RICARDO CAESAR LENZI
> Your email address    : RICARDO@K1.COM.BR
>
>
> System Configuration
> ---------------------
>   Architecture (example: Intel Pentium)      : INTEL PENTIUM
>
>   Operating System (example: Linux 2.0.26 ELF)     : LINUX 2.2.16
>
>   PostgreSQL version (example: PostgreSQL-7.1.1): PostgreSQL-7.2devel
>
>   Compiler used (example:  gcc 2.95.2)        : GCC 2.91.66
>
>
> Please enter a FULL description of your problem:
> ------------------------------------------------
>
> Python handle as string all int8 values from postgresql. This could be
> view when using the aggregate function count() and function nextval
> that returns an int8 value, but in python is represented like string:
>
> >> db.query("select nextval('my_seq')").getresult()
> [('2',)]
>
> >> db.query("select count(*) from films").dictresult()
> [{'count': '120'}]
>
>
> Please describe a way to repeat the problem.   Please try to provide a
> concise reproducible example, if at all possible:
> ----------------------------------------------------------------------
>
> see previous.
>
>
> If you know how this problem might be fixed, list the solution below:
> ---------------------------------------------------------------------
>
> Patch the file src/interfaces/python/pgmodule.c with the
> patch file attached in this mail.
>
>
> Please commit this before the version 7.2.
> Thanks and congratulations for the good job,
> Ricardo.

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: PyGreSQL v3.2 doesn't support INT8 types

От
Bruce Momjian
Дата:
Patch applied.  Thanks.

---------------------------------------------------------------------------


> ============================================================================
>                         POSTGRESQL BUG REPORT TEMPLATE
> ============================================================================
>
>
> Your name        : RICARDO CAESAR LENZI
> Your email address    : RICARDO@K1.COM.BR
>
>
> System Configuration
> ---------------------
>   Architecture (example: Intel Pentium)      : INTEL PENTIUM
>
>   Operating System (example: Linux 2.0.26 ELF)     : LINUX 2.2.16
>
>   PostgreSQL version (example: PostgreSQL-7.1.1): PostgreSQL-7.2devel
>
>   Compiler used (example:  gcc 2.95.2)        : GCC 2.91.66
>
>
> Please enter a FULL description of your problem:
> ------------------------------------------------
>
> Python handle as string all int8 values from postgresql. This could be
> view when using the aggregate function count() and function nextval
> that returns an int8 value, but in python is represented like string:
>
> >> db.query("select nextval('my_seq')").getresult()
> [('2',)]
>
> >> db.query("select count(*) from films").dictresult()
> [{'count': '120'}]
>
>
> Please describe a way to repeat the problem.   Please try to provide a
> concise reproducible example, if at all possible:
> ----------------------------------------------------------------------
>
> see previous.
>
>
> If you know how this problem might be fixed, list the solution below:
> ---------------------------------------------------------------------
>
> Patch the file src/interfaces/python/pgmodule.c with the
> patch file attached in this mail.
>
>
> Please commit this before the version 7.2.
> Thanks and congratulations for the good job,
> Ricardo.

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: PyGreSQL v3.2 doesn't support INT8 types

От
Gerhard Häring
Дата:
On Thu, Oct 11, 2001 at 09:44:58PM -0200, Ricardo Caesar Lenzi wrote:
> ============================================================================
>                         POSTGRESQL BUG REPORT TEMPLATE
> ============================================================================
>
>
> Your name        : RICARDO CAESAR LENZI
> Your email address    : RICARDO@K1.COM.BR
>
>
> System Configuration
> ---------------------
>   Architecture (example: Intel Pentium)      : INTEL PENTIUM
>
>   Operating System (example: Linux 2.0.26 ELF)     : LINUX 2.2.16
>
>   PostgreSQL version (example: PostgreSQL-7.1.1): PostgreSQL-7.2devel
>
>   Compiler used (example:  gcc 2.95.2)        : GCC 2.91.66

This is missing the Python version and build options, if any (like
--with-pymalloc). Please provide these in the next bugreport.

> Please enter a FULL description of your problem:
> ------------------------------------------------
>
> Python handle as string all int8 values from postgresql. This could be
> view when using the aggregate function count() and function nextval
> that returns an int8 value, but in python is represented like string:
>
> >> db.query("select nextval('my_seq')").getresult()
> [('2',)]
>
> >> db.query("select count(*) from films").dictresult()
> [{'count': '120'}]
>
>
> Please describe a way to repeat the problem.   Please try to provide a
> concise reproducible example, if at all possible:
> ----------------------------------------------------------------------
>
> see previous.
>
>
> If you know how this problem might be fixed, list the solution below:
> ---------------------------------------------------------------------
>
> Patch the file src/interfaces/python/pgmodule.c with the
> patch file attached in this mail.
>
>
> Please commit this before the version 7.2.
> Thanks and congratulations for the good job,
> Ricardo.

I've verified all that. The patch does the right thing.

+1 from me

Gerhard
--
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))