pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: pgsql-odbc@postgresql.org
Subject: Re: Unexpected ADO properties
Date: Mon, 22 Aug 2005 13:54:03 +0930
Message-ID: <debk15$pfk$1@news.hub.org> (raw)
References: <20050820115339.D2B57834@dm21.mta.everyone.net>

"Bernard Henry Voynet" <bhv@quebecemail.com> wrote in message 
news:20050820115339.D2B57834@dm21.mta.everyone.net...
> Hello
> I  am  working  on  a project that access databases through ADO
> over ODBC and must now include PostgreSQL.
>
> The  code  of  this  project  needs  to  know  about the fields
> caracteristics like whether or not it is:
> - a primary key
> - an autoincrement key
> - nullabble
> - updatable
> - etc..
>
> For   this   I   use   the  ADO  properties  that  give  theses
> informations.
>
> For a Jet database I get (for example):
> serialkey
>     Type = adInteger
>     DefinedSize = 4
>     Precision = 10
>     NumericScale = 255
>     Status = adRecOK
>     Attributes = adFldFixed
>     Properties (9)
>          BASECATALOGNAME (adVarWChar) = (Null)
>          BASECOLUMNNAME (adVarWChar) = serialkey
>          BASESCHEMANAME (adVarWChar) = (Null)
>          BASETABLENAME (adVarWChar) = genericfields
>          CALCULATIONINFO (adVarBinary) = (Null)
>          ISAUTOINCREMENT (adBoolean) = True
>          KEYCOLUMN (adBoolean) = True
>          OPTIMIZE (adBoolean) = False
>          RELATIONCONDITIONS (adVarBinary) = (Null)
>
> However, with  PostgreSQL  8.0.3  (psqlodc 08.00.0102), I don't get what 
> is expected.
>
> When I declare le serialkey field as as SERIAL PRIMARY KEY, instead of the 
> expected result, I get:
> serialkey
>     Type = adInteger
>     DefinedSize = 4
>     Precision = 10
>     NumericScale = 255
>     Status = adRecOK
>     Attributes = adFldUnknownUpdatable, adFldFixed, adFldIsNullable, 
> adFldMayBeNull
>     Properties (9)
>          BASECATALOGNAME (adVarWChar) = (Null)
>          BASECOLUMNNAME (adVarWChar) = serialkey
>          BASESCHEMANAME (adVarWChar) = (Null)
>          BASETABLENAME (adVarWChar) = genericfields
>          CALCULATIONINFO (adVarBinary) = (Null)
>          ISAUTOINCREMENT (adBoolean) = False
>          KEYCOLUMN (adBoolean) = True
>          OPTIMIZE (adBoolean) = False
>          RELATIONCONDITIONS (adVarBinary) = (Null)
>
> Where both:
> - Attributes
> - ISAUTOINCREMENT
> Are not correct since serialkey is a non nullable serial key

PostgreSQL has no notion of "autoincrement".  The "serial" type is an 
equivalent implementation, but is not actually a type in itself; it is an 
integer type with a default value drawn from a sequence.

The values reported in the "attributes" are certainly wrong; this is 
definitely a bug somewhere, but where, I don't know enough to say.  Perhaps 
someone more knowledgeable can help.

>
> Would you have any idea on this problem ?
> And any help to get the right values ?
>
> Best regards
>
>
> _____________________________________________________________
> Obtenez aussi votre adresse electronique gratuite de
> Quebecemail.com http://www.quebecemail.com, un service gratuit et 
> permanent.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
> 





view thread (4+ messages)  latest in thread

Message-ID: <debk15$pfk$1@news.hub.org>
Permalink:  ../debk15$pfk$1@news.hub.org/
Also on:    postgresql.org/message-id/debk15$pfk$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: jeff_eckermann@yahoo.com
  Subject: Re: Unexpected ADO properties
  In-Reply-To: <debk15$pfk$1@news.hub.org>
  References: <20050820115339.D2B57834@dm21.mta.everyone.net> <debk15$pfk$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox