Re: Problems with description structure

Gerhard Häring <[email protected]> Wed, 13 Aug 2003 16:35:44 +0200
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
Cc-ing pypgsql-users, let's please keep the discussion there :)

Dick Kniep wrote:
> Hi Gerhard,
> 
>>Do you mean the displaysize field of cursor.description? 
> 
> Yes
> 
>>In newer pyPgSQL releases this is indeed always set to None, because PostgreSQL 
>>versions 7.3 and later provide no means of getting at this information 
>>any more.
> 
> Why is this? Is there a rationale for this? 

Dunno. You could check the PostgreSQL archives. I personally never found 
this attribute useful.

> I thought it was pretty handy to have these values available? 

Are you really having problems with the 'display_size' field?

Qutoing the DB-API spec (PEP 0249):

"""
         .description

             This read-only attribute is a sequence of 7-item
             sequences.  Each of these sequences contains information
             describing one result column: (name, type_code,
             display_size, internal_size, precision, scale,
             null_ok). The first two items (name and type_code) are
             mandatory, the other five are optional and must be set to
             None if meaningfull values are not provided.
"""

> Is there an alternative to get these values?

For display_size, no. If a different field doesn't work as expected, we 
need to know which one it is.

-- Gerhard


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01