[DB-SIG] DB API v2.0 : how am I to get a field default value if it isn't in Cursor.description

Eugene P. Sizikov esizikov@teleross.ru
06 Mar 2003 10:27:30 +0800


Hello, Anthony!

Well, with MySQL too, but you'll need special (administrator) priveleges
to read that tables which is not good (security and roles).

Any other way?


06.03.2003, at 10:06, Anthony Baxter wrote:
> >>> "Eugene P. Sizikov" wrote
> > Hello!
> > 
> > I'm using Python with MySQLdb (DB API v2.0 compatible), and surpriselly
> > have not found a way to get some SQL table structural information such
> > as fields DEFAULT value and fields index type (PRIMARY, FOREIGN, UNIQUE,
> > MULTIPLE and so on). How am I to get that info if it isn't in
> > Cursor.description? While looking into MySQL-python sources I realized
> > that the info (at least default values) is just unused when the Python
> > 'description' tuple is constructed.
> 
> With databases like Oracle, there are other system tables in the database
> that contain this information.
> 
> Anthony


Best regards
Eugene Sizikov
Golden Telecom, TeleRoss
Russian Federation