Обсуждение: ODBC & Postgres problem

Поиск
Список
Период
Сортировка

ODBC & Postgres problem

От
Tim Bosinius
Дата:
I am new to this mailing-list and I have a problem with (Insight)ODBC & PostgreSQL.
I have searched the pgsql-interfaces archive to solve my problem but that did not
help me much.

I have installed - following the steps in the INSTALL readme -
postgresql 6.3.2 on my linux (glibc) server

I am trying to access a database I created with InsightDist ODBC and Visual
Basic 5.0 RDO and I have two problems.

First of all postgres uses alot of memory and is really slow, while an ODBC
connection is active:

[postgres@downtown /root]$ ps aux | grep postgres
postgres 19740  0.0  0.5  1420   252  p0 S   20:56   0:00 su postgres
postgres 19741  0.0  1.2  1172   580  p0 S   20:56   0:00 bash
postgres 19746  0.0  0.6  5060   284  p0 S   20:57   0:00 postmaster -i -B 256
postgres 19749 13.2 82.5 56664 38704  p0 S   20:58   0:16 /usr/local/pgsql/bin/postgres -p -Q -P5 -B 256 -v 65536 foo
postgres 19753  0.0  1.0   832   504  p0 R   21:00   0:00 ps aux
postgres 19754  0.0  1.2  1172   580  p0 R   21:00   0:00 bash
[postgres@downtown /root]$


I have 48MB Ram and a big swap, but it uses far too much memory.

The second problem I run into is that when I use RDO or RDC/RDO I cannot activate the
"UseCursor" Option for the ODBC driver and I everytime I try to insert,update or
delete a record I am told that the resultset is writeprotected (Error number 40048)

Can anybody help me one these problems.


Regards,

Tim Bosinius


Re: [INTERFACES] ODBC & Postgres problem

От
Byron Nikolaidis
Дата:

Tim Bosinius wrote:

> The second problem I run into is that when I use RDO or RDC/RDO I cannot activate the
> "UseCursor" Option for the ODBC driver and I everytime I try to insert,update or
> delete a record I am told that the resultset is writeprotected (Error number 40048)
>

When the "Use Cursor" option is checked, the driver will use the Postgres declare/fetch mechanism to retrieve a set of
rows from the backend into its 100 row cache.  Perhaps the name is confusing because odbc has the concept of scrollable
cursors, which is entirely different.  When checked, you get efficient, lets say read-only access, to your data.  It is
especially good for large tables, because if you were to try to pull all of the records of a large table into memory,
you
probably would crash your system.

When "Use Cursors" is checked, the driver dis-allows SQLExtendedFetch and will only support a forward only cursor.
This
is useful when all you care about is efficient read-only access.   When it is not checked, it will allow a "static"
cursor and SQLExtendedFetch also.  This is probably what you want.  At least under mfc, however, you need to use the
odbc
cursor library dll to be able to do recordset updates, because the driver does not support positioned updates or
SQLSetPos.

I am currently testing these things with mfc and hopefully will know more soon.  The more feedback I can get regarding
scrolling cursors with mfc or basic, the better things will be.

There is also the concept of the keyset driven cursor, which the driver currently does not support.  This corresponds
to
the dynaset on mfc.

If you look at the interfaces list, you may see that I mentioned cursor support and what kind of options we are looking
into supporting.  I am glad these problems are coming out because I want to understand these cursor types and also
support them better.

Byron