Re: understanding .description newbie ?
Tim Roberts <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Organization | Providenza & Boekelheide, Inc. |
| Message-ID | <[email protected]> |
johnf wrote:
> On Tuesday 05 May 2009 09:59:29 am johnf wrote:
>
>> dbapi 2.0 defines what a cursor.description returns. In my case the
>> cursor.description returns {fieldName, someNumber, None,...}. I would like
>> to better understand what the "someNumber" means. How does python know
>> that '1043' is a varchar (python string??).
>>
>
> A little more reseach revealed that the numbers are defined in pg_types.h ( a
> header for postgres). If this is wrong would someone take the time to let me
> know. From what I see it is a very close match.
>
Yes, but remember that these are specific to Postgres. MySql has its
own set of numbers, as do Jet and OLEDB and SQLlite, et al. Each
database adapter has to know the numbers for the database it is wrapping.
--
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.