From: Dave Page <dpage@vale-housing.co.uk>
To: Th.Knoop@Talisma.nl
To: pgsql-odbc@postgresql.org
Subject: Re: PostgreSQL / ODBC / Ms-SQL 2000
Date: Wed, 28 Sep 2005 20:04:27 +0100
Message-ID: <021801c5c45f$75893545$6a01a8c0@valehousing.co.uk> (raw)
-----Original Message-----
From: "Thomas Knoop"<Th.Knoop@Talisma.nl>
Sent: 28/09/05 18:47:43
To: "pgsql-odbc@postgresql.org"<pgsql-odbc@postgresql.org>
Subject: Re: [ODBC] PostgreSQL / ODBC / Ms-SQL 2000
Hi Thomas,
>> SELECT * FROM OPENQUERY(MYLINKEDSERVER, 'SELECT * FROM public.mytable')
> As far I can see this tries to open the table complete, and fails in my case
> cause i have a ADSL connection and it tries to fetch all the records....
So modify the query as required...
SELECT * FROM OPENQUERY(MYLINKEDSERVER, 'SELECT * FROM public.mytable WHERE foo < 10 LIMIT 5')
The query in thhe function call is executed by the linked server so PG will restrict the resultset within the bound of the LIMIT and WHERE clauses.
Anything else is down to SQL Server...
Regards, Dave
-----Unmodified Original Message-----
Hi Dave,
First let me thank you for your input!
> > When I look at the properties of the linked server in Ms-SQL I can
> > see that the catalog column is empty. I think MS-SQL expects a
> > (default?) value here,
> > and thats why we cannot proceed creating a view.
>
> If SQL is expecting a value here even though the driver reports that
> catalogs are not supported by the database then it's broken.
> I'll see if
> I can find some time to try to work out whats going on in the week. I
> can't promise anything though.
> According the SQL docs, the correct syntax is something like:
> SELECT * FROM MYLINKEDSERVER..[public].mytable;
> However I can't get this to work. This does seem fairly common though,
> with other users complaining of the same issues with Oracle. The commonly
> suggested solution is to use:
> SELECT * FROM OPENQUERY(MYLINKEDSERVER, 'SELECT * FROM public.mytable')
> Which works perfectly afaict, apart from a minor issue with columns of
> type 'name', for which I've just committed a fix to CVS.
As far I can see this tries to open the table complete, and fails in my case
cause i have a ADSL connection and it tries to fetch all the records....
This looks to me as a very slow workaround.
Regards,
Thomas.
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: dpage@vale-housing.co.uk, Th.Knoop@Talisma.nl
Subject: Re: PostgreSQL / ODBC / Ms-SQL 2000
In-Reply-To: <021801c5c45f$75893545$6a01a8c0@valehousing.co.uk>
References: <021801c5c45f$75893545$6a01a8c0@valehousing.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox