Re: Weird problem with aggregate functions

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема Re: Weird problem with aggregate functions
Дата
Msg-id 3BE7C1BB.BAB98D0C@tpf.co.jp
обсуждение исходный текст
Ответ на Weird problem with aggregate functions  ("Andrea Aime" <aaime@comune.modena.it>)
Список pgsql-odbc
Andrea Aime wrote:
>
> Hi everybody,
> I got a problem with aggregate functions from VB 6. SUM, AVG, STDDEV,
> and VARIANCE doesn't work on int4 types (but they're working on float8),
> whereas MAX and MIN work also on int4... that's weird!
> Even more strange, the above functions work both from psql and from
> pgAdmin II... but not in the following code:
>
> Private Sub Form_Load()
>   Dim conn As ADODB.Connection
>   Dim rec As ADODB.Recordset
>   Dim cmd As Command
>
>   Set conn = New Connection
>   conn.CursorLocation = adUseClient

This indicates ADO to use Microsoft Cursor Service for OLE DB.
Microsoft Cursor Service seems to expect the server to
return e.g. int4 type for sum(int4) but PostgreSQL returns
numeric type as sum(int4).
Probably you would get the expected result if you
use sum(..)::int4.

regards,
Hiroshi Inoue

В списке pgsql-odbc по дате отправления:

Предыдущее
От: "Andrea Aime"
Дата:
Сообщение: Weird problem with aggregate functions
Следующее
От: "Andrea Aime"
Дата:
Сообщение: Re: Weird problem with aggregate functions