Thread: MS-QUERY / Postgresql ODBC driver incompatibility

MS-QUERY / Postgresql ODBC driver incompatibility

From
Info Agipa
Date:
Hello.

I've found a problem in using the postgresql ODBC driver with MS-QUERY.
MS-Query is the tool included in Microsoft Office to access db in excel.

If I type in ms-query :
select code as groupe_clients, libelle
from groupes_clients

I have an error message. After some search, it appears that postgresql receive :
select code as 'groupe_clients', libelle
from groupe_clients

But postgresql don't want ' but double quote " in the as part.

MS-Query doesn't include a parameter to change this.

It seems to be a ms-query bug...

If no solution exists, I think it's a good idea to include an alert in the faq
(http://psqlodbc.projects.pgfoundry.org/faq.html)

As I have searching for a loooong time on google to see what I can make to fix this.
Am I the only one wich access to postgresql in excel using ms-query and with as clause ?

my ODBC driver version : 8.03.02.00
my PostgreSQL database version : 8.4.16

Thanks for your attention.

Sylvain Fauveau

Re: MS-QUERY / Postgresql ODBC driver incompatibility

From
Adrian Klaver
Date:
On Tue, Nov 5, 2013 at 5:00 AM, Info Agipa <info@apli-agipa.com> wrote:
> Hello.
>
> I've found a problem in using the postgresql ODBC driver with MS-QUERY.
> MS-Query is the tool included in Microsoft Office to access db in excel.
>
> If I type in ms-query :
> select code as groupe_clients, libelle
> from groupes_clients
>
> I have an error message. After some search, it appears that postgresql receive :
> select code as 'groupe_clients', libelle
> from groupe_clients

So what if you do:

select code as "groupe_clients", libelle
from groupes_clients


Also you might try creating the query in the Query Designer and
specifying  groupe_clients
as the alias. This is how I do it I have not had any issues.



>
> But postgresql don't want ' but double quote " in the as part.
>
> MS-Query doesn't include a parameter to change this.
>
> It seems to be a ms-query bug...
>
> If no solution exists, I think it's a good idea to include an alert in the faq
(http://psqlodbc.projects.pgfoundry.org/faq.html)
>
> As I have searching for a loooong time on google to see what I can make to fix this.
> Am I the only one wich access to postgresql in excel using ms-query and with as clause ?
>
> my ODBC driver version : 8.03.02.00
> my PostgreSQL database version : 8.4.16
>
> Thanks for your attention.
>
> Sylvain Fauveau



--
Adrian Klaver
adrian.klaver@gmail.com


RE : MS-QUERY / Postgresql ODBC driver incompatibility

From
Info Agipa
Date:
>So what if you do:
>
>select code as "groupe_clients", libelle
>from groupes_clients
I've got an error:
ERREUR: erreur de syntaxe sur ou près de << 'groupe_clients' >>;
Error while executing the query

>Also you might try creating the query in the Query Designer and
>specifying  groupe_clients
>as the alias. This is how I do it I have not had any issues.
I've got the same error

I'm very surprised that you can make it.
It seems MS-QUERY use ' to quote an alias (containing a space or not).
And it seems that pgsql-odbc don't translate it to "




Re: MS-QUERY / Postgresql ODBC driver incompatibility

From
Nils Gösche
Date:
Sylvain Fauveau wrote:

> my ODBC driver version : 8.03.02.00
> my PostgreSQL database version : 8.4.16

If I am not mistaken, that driver is five years old.  Try to grab a recent version from

http://www.postgresql.org/ftp/odbc/versions/msi/

I'd try 9.2.1. (Should work fine with Postgres 8.4 in case you're wondering.)

Regards,
--
Nils Gösche
"Don't ask for whom the <CTRL-G> tolls."


Attachment

RE : MS-QUERY / Postgresql ODBC driver incompatibility

From
Info Agipa
Date:
Sorry, spec from old server.

In the new server server in exploitation from last month :
ODBC driver version : 9.02.01.00
postgresql version : 9.3

________________________________________
De : pgsql-odbc-owner@postgresql.org [pgsql-odbc-owner@postgresql.org] de la part de Nils Gösche [cartan@cartan.de]
Date d'envoi : mercredi 6 novembre 2013 11:31
À : Info Agipa; pgsql-odbc@postgresql.org
Objet : Re: [ODBC] MS-QUERY / Postgresql ODBC driver incompatibility

Sylvain Fauveau wrote:

> my ODBC driver version : 8.03.02.00
> my PostgreSQL database version : 8.4.16

If I am not mistaken, that driver is five years old.  Try to grab a recent version from

http://www.postgresql.org/ftp/odbc/versions/msi/

I'd try 9.2.1. (Should work fine with Postgres 8.4 in case you're wondering.)

Regards,
--
Nils Gösche
"Don't ask for whom the <CTRL-G> tolls."