Re: SQL Server access from PostgreSQL

From: Serge Fonville <serge(dot)fonville(at)gmail(dot)com>
To: Geoff Montee <geoff(dot)montee(at)gmail(dot)com>
Cc: Filip Rembiałkowski <filip(dot)rembialkowski(at)gmail(dot)com>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: SQL Server access from PostgreSQL
Date: 2015-06-07 08:00:54
Message-ID: CAOAS_+KKKUs4uJwDO2rrM2ASwUBQC87mnTnT7C30AOgYa4F9eA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If you use odbc you should be able to use
https://msdn.microsoft.com/en-us/library/hh568451%28v=sql.110%29.aspx

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

2015-06-07 1:08 GMT+02:00 Geoff Montee <geoff(dot)montee(at)gmail(dot)com>:

> On Mon, May 18, 2015 at 11:24 AM, Geoff Montee <geoff(dot)montee(at)gmail(dot)com>
> wrote:
> >
> > The NOTICE right before the error might provide useful information:
> >
> > NOTICE: DB-Library notice: Msg #: 40508, Msg state: 1, Msg: USE
> > statement is not supported to switch between databases. Use a new
> > connection to connect to a different database., Server: ms, Process:
> > ,Line: 1, Level: 16
> >
> > tds_fdw doesn't explicitly call the "USE" statement. It calls the
> > dbuse() DB-Library function:
> >
> > https://github.com/GeoffMontee/tds_fdw/blob/master/src/tds_fdw.c#L703
> >
> >
> http://www.freetds.org/reference/a00341.html#ga66ea891910f0a357cc78107d6ab7d962
> >
> > This function does seem to call USE behind the scenes:
> >
> > https://github.com/FreeTDS/freetds/blob/master/src/dblib/dblib.c#L1414
> >
> > This seems to be a limitation specific to Azure. Are you using that?:
> >
> > http://stackoverflow.com/a/14167073/1732980
> >
> > I'll try to come up with a permanent fix for this at some point. I
> > added this bug to GitHub. Feel free to subscribe to it:
> >
> > https://github.com/GeoffMontee/tds_fdw/issues/23
> >
>
> If anyone else is having issues using tds_fdw with Microsoft Azure,
> the latest commit adds a foreign server-level "database" option which
> fixes the dbuse() issue with Azure. See the GitHub issue for details:
>
> https://github.com/GeoffMontee/tds_fdw/issues/23#issuecomment-109655082
>
> I'll probably package up a tds_fdw 1.0.2 release relatively soon.
>
> Thanks,
>
> Geoff Montee
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2015-06-08 02:37:23 Re: BDR - Failure of Primary Server - How to recover?
Previous Message Geoff Montee 2015-06-06 23:08:05 Re: SQL Server access from PostgreSQL