Обсуждение: new odbc fails

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

new odbc fails

От
"John J. Boris, Sr."
Дата:
I downloaded and installed the new odbc driver. I am running WIndows NT 4.0
and my PostreSQL is on a LINUX box. I can connect to the database using MS
Access 97, link the tables, it allows me to select unique keys for each
table but when I try to view a table I get an ODBC failed message and the
table is filled with NAME#.

I have the user set to postgres abnd the correct password.
Any ideas as to why I can't see any of the data from my table or can't I
link the MS Access table to the PostgreSQL?

John J. Boris, Sr.   Boris Computer Services/ONLine Services
email:john.boris@onlinesvc.com.com
bbs: The Bleeding Edge 609-858-9221
http:\\www.onlinesvc.com
telnet:www.onlinesvc.com
Busines Phone 609-869-9620


Re: [INTERFACES] new odbc fails

От
David Hartwig
Дата:

John J. Boris, Sr. wrote:

> I downloaded and installed the new odbc driver. I am running WIndows NT 4.0
> and my PostreSQL is on a LINUX box. I can connect to the database using MS
> Access 97, link the tables, it allows me to select unique keys for each
> table but when I try to view a table I get an ODBC failed message and the
> table is filled with NAME#.

I need a little more information.

    Version of PostgreSQL server?

    Version of ODBC Driver?   I know you say you have the latest, but we have
had some confusion  in the past with old FTP sites.

Could you turn the CommLog under the Advanced Driver Options and send the
results of your interaction.   The log file is C:\psqlodbc.log.   You must
close the application before the logging activity is flushed.

>
>
> I have the user set to postgres abnd the correct password.
> Any ideas as to why I can't see any of the data from my table or can't I
> link the MS Access table to the PostgreSQL?




Re: [INTERFACES] new odbc fails

От
Byron Nikolaidis
Дата:

John J. Boris, Sr. wrote:

> I downloaded and installed the new odbc driver. I am running WIndows NT 4.0
> and my PostreSQL is on a LINUX box. I can connect to the database using MS
> Access 97, link the tables, it allows me to select unique keys for each
> table but when I try to view a table I get an ODBC failed message and the
> table is filled with NAME#.
>

This is most likely because of the backend canonifier problem.  Check your
psqlodbc.log (enabled with the CommLog driver option) file to see if there is
an error message from the backend concerning "palloc failure, memory
exhausted".

The unique key you are specifying in Access can result in "keyset" queries of
the form:

select from table where (k1 = 1 AND k2 = 1 AND k3 = 1) OR (k1 = 1 AND k2 = 1
AND k3 = 2) ......... (k1 = 1 and k2 = 1 and k3 = 10)

Access usually uses a rowset size of 10, thus you will have 10 groups of ORs.
Depending on how many parts your key is made up of, your AND groupings may look
differently than I have shown it.

Bottom line is, a fix for the backend is being worked on in two different
capacities.  One fix, which we use here, is a patch, written by Dave Hartwig,
which rewrites the statements into UNIONS in the backend.  This is called the
KSQO patch (KeySet Query Optimization, enabled with the set ksqo to 'ON'
command, which you can put in the Connect Settings driver/datasource options).
I'm not sure if we have this patch on our website or if it will be included in
Postgres 6.4.  You may want to check the website and inquire about it.

Also, Bruce Momjian  is trying to fix the problem in the backend.  I'm not sure
of its current status or if it will be complete in Postgres 6.4.

Byron



Re: [INTERFACES] new odbc fails

От
Bruce Momjian
Дата:
>
>
> John J. Boris, Sr. wrote:
>
> > I downloaded and installed the new odbc driver. I am running WIndows NT 4.0
> > and my PostreSQL is on a LINUX box. I can connect to the database using MS
> > Access 97, link the tables, it allows me to select unique keys for each
> > table but when I try to view a table I get an ODBC failed message and the
> > table is filled with NAME#.
> >
>
> This is most likely because of the backend canonifier problem.  Check your
> psqlodbc.log (enabled with the CommLog driver option) file to see if there is
> an error message from the backend concerning "palloc failure, memory
> exhausted".
>
> The unique key you are specifying in Access can result in "keyset" queries of
> the form:
>
> select from table where (k1 = 1 AND k2 = 1 AND k3 = 1) OR (k1 = 1 AND k2 = 1
> AND k3 = 2) ......... (k1 = 1 and k2 = 1 and k3 = 10)
>
> Access usually uses a rowset size of 10, thus you will have 10 groups of ORs.
> Depending on how many parts your key is made up of, your AND groupings may look
> differently than I have shown it.
>
> Bottom line is, a fix for the backend is being worked on in two different
> capacities.  One fix, which we use here, is a patch, written by Dave Hartwig,
> which rewrites the statements into UNIONS in the backend.  This is called the
> KSQO patch (KeySet Query Optimization, enabled with the set ksqo to 'ON'
> command, which you can put in the Connect Settings driver/datasource options).
> I'm not sure if we have this patch on our website or if it will be included in
> Postgres 6.4.  You may want to check the website and inquire about it.
>
> Also, Bruce Momjian  is trying to fix the problem in the backend.  I'm not sure
> of its current status or if it will be complete in Postgres 6.4.

I am ready to address this.  I will send an e-mail today.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

Re: [INTERFACES] new odbc fails

От
David Hartwig
Дата:
I the short term you may use OID as your key and just hide the OID column in your
app.     You should throw a unique index on OID.  And set the driver option to
show OID.




Re: [INTERFACES] new odbc fails

От
David Hartwig
Дата:
Byron was correct.   That message comes from the backend.   If you cut out that
last query with all the ANDs and OR's, you will see what I mean.     There will be
something in 6.4 to handle this.   I am awaiting Bruce's comments to see what form
the solution  will take.

John J. Boris, Sr. wrote:

> >    Version of PostgreSQL server?
> PostgreSQL 6.3.1
> >
> >    Version of ODBC Driver?   I know you say you have the latest, but we have
> >had some confusion  in the past with old FTP sites.
> PostgreSQL 6.30.0247 from Insight Distribution Systems
> >
> >Could you turn the CommLog under the Advanced Driver Options and send the
> >results of your interaction.   The log file is C:\psqlodbc.log.   You must
> >close the application before the logging activity is flushed.
> conn=156310432,
> SQLDriverConnect(out)='DRIVER={PostgreSQL};DATABASE=gsyfl;SERVER=bcs-2.onlin
> esvc.com;PORT=5432;UID=postgres;READONLY=0;PWD=onlinesvc;PROTOCOL=;FAKEOIDIN
> DEX=0;SHOWOIDCOLUMN=0;ROWVERSIONING=1;SHOWSYSTEMTABLES=1;CONNSETTINGS='
> Global Options: fetch=100, socket=4096, unknown_sizes=0,
> max_varchar_size=254, max_longvarchar_size=4094
>                 disable_optimizer=0, unique_index=0, use_declarefetch=1
>                 text_as_longvarchar=1, unknowns_as_longvarchar=1,
> bools_as_char=1
>                 extra_systable_prefixes='dd_;', conn_settings=''
> conn=156310432, query=' '
> conn=156310432, query='BEGIN'
> conn=156310432, query='set DateStyle to 'ISO''
> conn=156310432, query='declare SQL_CUR156368960 cursor for select oid from
> pg_type where typname='lo''
> conn=156310432, query='fetch 100 in SQL_CUR156368960'
>     [ fetched 0 rows ]
> conn=156310432, query='close SQL_CUR156368960'
> conn=156310432, query='END'
> conn=156310432, query='BEGIN'
> conn=156310432, query='declare SQL_CUR156368960 cursor for SELECT Config,
> nValue FROM MSysConf'
> ERROR from backend during send_query: 'ERROR:  msysconf: Table does not
> exist.'
> conn=156310432, query='ABORT'
> STATEMENT ERROR: func=SC_execute, desc='', errnum=1, errmsg='Error while
> executing the query'
>                  ------------------------------------------------------------
>                  hdbc=156310432, stmt=156368960, result=0
>                  manual_result=0, prepare=0, internal=0
>                  bindings=0, bindings_allocated=0
>                  parameters=0, parameters_allocated=0
>                  statement_type=0, statement='SELECT Config, nValue FROM
> MSysConf'
>                  stmt_with_params='declare SQL_CUR156368960 cursor for
> SELECT Config, nValue FROM MSysConf'
>                  data_at_exec=-1, current_exec_param=-1, put_data=0
>                  currTuple=-1, current_col=-1, lobj_fd=-1
>                  maxRows=0, rowset_size=1, keyset_size=0, cursor_type=0,
> scroll_concurrency=1
>                  cursor_name='SQL_CUR156368960'
>                  ----------------QResult Info -------------------------------
> CONN ERROR: func=SC_execute, desc='', errnum=10, errmsg='ERROR:  msysconf:
> Table does not exist.'
>             ------------------------------------------------------------
>             henv=156304960, conn=156310432, status=1, num_stmts=16
>             sock=156304976, stmts=156305024, lobj_type=-999
>             ---------------- Socket Info -------------------------------
>             socket=352, reverse=0, errornumber=0, errormsg='(null)'
>             buffer_in=156316448, buffer_out=156320552
>             buffer_filled_in=2, buffer_filled_out=0, buffer_read_in=2
> conn=156310432, query='BEGIN'
> conn=156310432, query='declare SQL_CUR156368960 cursor for SELECT
> "schedule"."sweek","schedule"."hteam","schedule"."vteam" FROM "schedule" '
> conn=156310432, query='fetch 100 in SQL_CUR156368960'
>     [ fetched 90 rows ]
> conn=156310432, query='close SQL_CUR156368960'
> conn=156310432, query='END'
> conn=156310432, query='BEGIN'
> conn=156310432, query='declare SQL_CUR156439880 cursor for SELECT
> "sdate","sweek","hteam","vteam","stimes"  FROM "schedule"  WHERE "sweek" =
> 1 AND "hteam" = 'LINDENBORO' AND "vteam" = 'G.T.LIONS' OR "sweek" = 1 AND
> "hteam" = 'VOORHEES' AND "vteam" = 'STERLING' OR "sweek" = 1 AND "hteam" =
> 'MARLTON' AND "vteam" = 'PYAA PANTHERS' OR "sweek" = 1 AND "hteam" = 'WASH.
> TWP. PATRIOTS' AND "vteam" = '' OR "sweek" = 1 AND "hteam" = 'HADDONFIELD'
> AND "vteam" = 'WINSLOW' OR "sweek" = 1 AND "hteam" = 'INTERBORO' AND
> "vteam" = 'WASH. TWP. MINUTEMAN' OR "sweek" = 1 AND "hteam" = 'BELLMAWR'
> AND "vteam" = 'GLOUCESTER' OR "sweek" = 1 AND "hteam" = 'WILLIAMSTOWN' AND
> "vteam" = 'GLASSBORO' OR "sweek" = 1 AND "hteam" = 'DEPTFORD' AND "vteam" =
> 'OAKLYN' OR "sweek" = 1 AND "hteam" = 'WILLINGBORO' AND "vteam" = 'PYAA
> LIONS''
> ERROR from backend during send_query: 'FATAL 1:  palloc failure: memory
> exhausted'
> STATEMENT ERROR: func=SC_execute, desc='', errnum=1, errmsg='Error while
> executing the query'
>                  ------------------------------------------------------------
>                  hdbc=156310432, stmt=156439880, result=0
>                  manual_result=0, prepare=1, internal=0
>                  bindings=0, bindings_allocated=0
>                  parameters=156368960, parameters_allocated=30
>                  statement_type=0, statement='SELECT
> "sdate","sweek","hteam","vteam","stimes"  FROM "schedule"  WHERE "sweek" =
> ? AND "hteam" = ? AND "vteam" = ? OR "sweek" = ? AND "hteam" = ? AND
> "vteam" = ? OR "sweek" = ? AND "hteam" = ? AND "vteam" = ? OR "sweek" = ?
> AND "hteam" = ? AND "vteam" = ? OR "sweek" = ? AND "hteam" = ? AND "vteam"
> = ? OR "sweek" = ? AND "hteam" = ? AND "vteam" = ? OR "sweek" = ? AND
> "hteam" = ? AND "vteam" = ? OR "sweek" = ? AND "hteam" = ? AND "vteam" = ?
> OR "sweek" = ? AND "hteam" = ? AND "vteam" = ? OR "sweek" = ? AND "hteam" =
> ? AND "vteam" = ?'
>                  stmt_with_params='declare SQL_CUR156439880 cursor for
> SELECT "sdate","sweek","hteam","vteam","stimes"  FROM "schedule"  WHERE
> "sweek" = 1 AND "hteam" = 'LINDENBORO' AND "vteam" = 'G.T.LIONS' OR "sweek"
> = 1 AND "hteam" = 'VOORHEES' AND "vteam" = 'STERLING' OR "sweek" = 1 AND
> "hteam" = 'MARLTON' AND "vteam" = 'PYAA PANTHERS' OR "sweek" = 1 AND
> "hteam" = 'WASH. TWP. PATRIOTS' AND "vteam" = '' OR "sweek" = 1 AND "hteam"
> = 'HADDONFIELD' AND "vteam" = 'WINSLOW' OR "sweek" = 1 AND "hteam" =
> 'INTERBORO' AND "vteam" = 'WASH. TWP. MINUTEMAN' OR "sweek" = 1 AND "hteam"
> = 'BELLMAWR' AND "vteam" = 'GLOUCESTER' OR "sweek" = 1 AND "hteam" =
> 'WILLIAMSTOWN' AND "vteam" = 'GLASSBORO' OR "sweek" = 1 AND "hteam" =
> 'DEPTFORD' AND "vteam" = 'OAKLYN' OR "sweek" = 1 AND "hteam" =
> 'WILLINGBORO' AND "vteam" = 'PYAA LIONS''
>                  data_at_exec=-1, current_exec_param=-1, put_data=0
>                  currTuple=-1, current_col=-1, lobj_fd=-1
>                  maxRows=0, rowset_size=1, keyset_size=0, cursor_type=0,
> scroll_concurrency=1
>                  cursor_name='SQL_CUR156439880'
>                  ----------------QResult Info -------------------------------
> CONN ERROR: func=SC_execute, desc='', errnum=8, errmsg='FATAL 1:  palloc
> failure: memory exhausted'
>             ------------------------------------------------------------
>             henv=156304960, conn=156310432, status=1, num_stmts=16
>             sock=156304976, stmts=156305024, lobj_type=-999
>             ---------------- Socket Info -------------------------------
>             socket=352, reverse=0, errornumber=0, errormsg='(null)'
>             buffer_in=156316448, buffer_out=156320552
>             buffer_filled_in=45, buffer_filled_out=0, buffer_read_in=45
> conn=156310432, SQLDisconnect
>
> John J. Boris, Sr.   Boris Computer Services/ONLine Services
> email:john.boris@onlinesvc.com.com
> bbs: The Bleeding Edge 609-858-9221
> http:\\www.onlinesvc.com
> telnet:www.onlinesvc.com
> Busines Phone 609-869-9620