X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BD2A5D9AC8 for ; Wed, 28 Sep 2005 16:04:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76088-04 for ; Wed, 28 Sep 2005 19:04:31 +0000 (GMT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by svr1.postgresql.org (Postfix) with ESMTP id 8D069D9A91 for ; Wed, 28 Sep 2005 16:04:31 -0300 (ADT) Received: from mailgate.vale-housing.co.uk ([194.217.48.34] helo=vale-housing.co.uk) by anchor-post-32.mail.demon.net with esmtp (Exim 4.42) id 1EKhEG-000N83-6v for pgsql-odbc@postgresql.org; Wed, 28 Sep 2005 19:04:32 +0000 Received: from 192.168.1.106 ([192.168.1.106]) by ratbert.vale-housing.co.uk ([192.168.1.106]) with Microsoft Exchange Server HTTP-DAV ; Wed, 28 Sep 2005 19:04:32 +0000 From: "Dave Page" To: , Subject: Re: PostgreSQL / ODBC / Ms-SQL 2000 Message-ID: <021801c5c45f$75893545$6a01a8c0@valehousing.co.uk> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 28 Sep 2005 20:04:27 +0100 MIME-Version: 1.0 thread-topic: [ODBC] PostgreSQL / ODBC / Ms-SQL 2000 thread-index: AcXDcm2LUtSb/oi/SfyG9siz54s8GgAK4auQABpaaGAAEYUY0AAEgNSB X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.594 required=5 tests=[AWL=-1.482, MSGID_DOLLARS=3.076] X-Spam-Level: * X-Archive-Number: 200509/190 X-Sequence-Number: 6088 -----Original Message----- From: "Thomas Knoop" Sent: 28/09/05 18:47:43 To: "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----- =20 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=20 > > 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. >=20 > If SQL is expecting a value here even though the driver reports that=20 > 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=20 > 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=20 > 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