Re: ECPG - Some errno definitions don't match to the manual

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Satoshi Nagayasu <satoshi(dot)nagayasu(at)gmail(dot)com>
Cc: pgsql-docs <pgsql-docs(at)postgresql(dot)org>, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: ECPG - Some errno definitions don't match to the manual
Date: 2010-08-09 12:27:27
Message-ID: AANLkTin286hRE0oLZFr4quDp6esNNztHmYUhfLO0vf_4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-general

2010/7/22 Satoshi Nagayasu <satoshi(dot)nagayasu(at)gmail(dot)com>:
> Hi all,
>
> I'm looking into some ecpg part of the official manual,
> and I have found some strange things.
>
> I'm now investigating SQLCODE and SQLSTATE, and I have found
> that some of the errno definitions don't match to the manual.
>
> For example, the manual says that ECPG_CONVERT_BOOL could be `-207'.
> However, ECPG_CONVERT_BOOL is defined as `-211' in ecpgerrno.h.
>
>> -207 (ECPG_CONVERT_BOOL)
>>
>>     This means the host variable is of type bool and the datum in the database is neither 't' nor 'f'. (SQLSTATE 42804)
>
> http://www.postgresql.org/docs/9.0/static/ecpg-errors.html
>
>> #define ECPG_NUMERIC_FORMAT           -207
>> #define ECPG_CONVERT_BOOL             -211
>
> http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/include/ecpgerrno.h?rev=1.27;content-type=text%2Fx-cvsweb-markup;only_with_tag=REL9_0_STABLE
>
> What does it mean? The manual is not up to date?

Yeah, I think that's what it means. Perhaps you could provide a patch
for the docs?

Another question is whether we oughn't to remove all mention of the
specific values of these constants from the documentation. That
wouldn't prevent all problems in this area, because constants can
still be added and removed, but ISTM that including the specific
numerical values here is encouraging people to depend on those values
when they probably shouldn't.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Robert Haas 2010-08-09 12:32:48 Re: pgbench acronym tps
Previous Message Robert Haas 2010-08-09 12:03:57 Re: Please provide stable target anchors

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2010-08-09 12:31:39 Re: InitDB: Bad system call
Previous Message Torsten Zühlsdorff 2010-08-09 11:56:13 InitDB: Bad system call