Re: [INTERFACES] Re: ODBC drive strange behavior
От | Jose Soares |
---|---|
Тема | Re: [INTERFACES] Re: ODBC drive strange behavior |
Дата | |
Msg-id | 388C6F34.608E5E4A@sferacarta.com обсуждение исходный текст |
Ответ на | Re: ODBC drive strange behavior (Jose Soares <jose@sferacarta.com>) |
Список | pgsql-interfaces |
Byron Nikolaidis wrote: <blockquote type="CITE">Jose Soares wrote: <br />> <br />> Sorry I forgot to send the attachement :) <br />> <br />> Jose Soares wrote: <br />> <br />> > Please help! <br />> > <br />>> The PSQLODBC aborts a transaction with a strange error while execute a <br />> > legal query. <br />>> The message is: <br />> > <br />> > "Could not begin a transaction; unexpected protocol characterfrom <br />> > backend (sen_query) (#1)" <br />> > <br />> > I tried the same query with psqlclient and it works with no problems. <br />> > <br />> > Does anyone know what this message means ? <br/>> > <br />> > My configuration: <br />> > <br />> > Data base server: PostgreSQL v6.5.2 <br/>> > OS server: Linux 2.0.37 (Debian) <br />> > Win Client: M$_Access95 <br />> > PsqlODBC v6.40.0006<br />> > log file attached. <br />> > <br />> > Any help would be very apreciated. <br />>> <br />> > José <br />> <br />> ------------------------------------------------------------------------<br />> Name: LOG_ERROR.log<br />> LOG_ERROR.log Type: Text Document (application/x-unknown-content-type-txtfile) <br />> Encoding: base64 <p>The error means the driver didn't receive the expected response <br />characterfrom the backend. For queries, the expected response would be <br />something like: <p>'T': results are coming(this one is the most likely expected) <br />'C': no tuples produced <br />'Z': ready for new query (in >= postgres6.4 only). <br />'I': empty query produces this response <br />'N': notice <br />'E': error <p>In your case, thequery begins: (SELECT "figure"."azienda" <p>It might be the extra parenthesis around the query ? Try removing <br />them. If that's not it, try making the query really short, just as an <br />experiment. Also, using the wrong protocolwith the backend can make <br />this happen. <p>Byron</blockquote><u>* About parenthesis around select this is theway M$-access translates</u><br /><u>queries with UNIONs and I can't do nothing to change this behavior.</u><br /><u>Thanksto developers, PostgreSQL now recognizes this syntax, in fact if I execute this query on psql</u><br /><u>it works.</u><p><u>*Just for an experiment I did the following change:</u><u></u><p><u>* The original query in M$-access was:</u><br/>( <br />SELECT figure.azienda ,figure.codice_figura ,utenti.ragione_sociale ,utenti.istat ,utenti.cap, <br /> utenti.indirizzo ,utenti.civico ,figure.tipo ,utenti.codice_fiscale ,utenti.partita_iva , <br /> figure.fine_attivita,figure.data_esportazione ,figure.data_aggiornamento ,utenti.distretto, <br /> figure.gruppo ,figure.data_esportazione,utenti.data_esportazione <br />FROM figure INNER JOIN utenti ON (figure.codice_figura = utenti.azienda)<br />WHERE (figure.tipo IN ('D' ,'DB' ,'DO' ,'DS' ) ) <br /> ) <br />UNION ALL <br />( <br />SELECT figure.azienda,figure.codice_figura ,utenti.ragione_sociale ,utenti.istat , <br /> utenti.cap ,utenti.indirizzo,utenti.civico,figure.tipo,utenti.codice_fiscale,<br /> utenti.partita_iva ,figure.fine_attivita ,figure.data_esportazione,<br /> figure.data_aggiornamento,utenti.distretto,figure.gruppo,figure.data_esportazione, <br/> utenti.data_esportazione <br />FROM figure INNER JOIN utenti ON (figure.codice_figura = utenti.azienda) <br />WHERE(figure.tipo IN ('P' ,'PB' ,'PO' ,'PS' ,'A' ) ) <br />) <p><u>and it was translated to PostgreSQL as:</u><p>(SELECT"figure"."azienda" ,"figure"."codice_figura" ,"utenti"."ragione_sociale" ,"utenti"."istat" ,"utenti"."cap","utenti"."indirizzo" ,"utenti"."civico" ,"figure"."tipo" ,"utenti"."codice_fiscale" ,"utenti"."partita_iva","figure"."fine_attivita" ,"figure"."data_esportazione" ,"figure"."data_aggiornamento" ,"utenti"."distretto","figure"."gruppo" ,"figure"."data_esportazione" ,"utenti"."data_esportazione" <br />FROM "figure","utenti"<br />WHERE (("figure"."tipo" IN ('D' ,'DB' ,'DO' ,'DS' ) ) <br />AND ("figure"."codice_figura" = "utenti"."azienda") ) <br />) <br />UNION ALL <br />( <br />SELECT "figure"."azienda" ,"figure"."codice_figura" ,"utenti"."ragione_sociale","utenti"."istat" ,"utenti"."cap" ,"utenti"."indirizzo" ,"utenti"."civico" ,"figure"."tipo" ,"utenti"."codice_fiscale","utenti"."partita_iva" ,"figure"."fine_attivita" ,"figure"."data_esportazione" ,"figure"."data_aggiornamento","utenti"."distretto" ,"figure"."gruppo" ,"figure"."data_esportazione" ,"utenti"."data_esportazione"<br />FROM "figure","utenti" <br />WHERE (("figure"."tipo" IN ('P' ,'PB' ,'PO' ,'PS' ,'A' )) <br />AND ("figure"."codice_figura" = "utenti"."azienda" ) ) <br />) <p><u>I replaced the keyword INNER with LEFT andnow it works but I can't realize why.</u><u></u><p><u>Any ideas Byron ?</u><u></u><p><u>Thanks,</u><br /><u>José</u><br/><u></u>
В списке pgsql-interfaces по дате отправления:
Предыдущее
От: Compte utilisateur Sultan-advlДата:
Сообщение: Re: [INTERFACES] Re: ODBC drive strange behavior