pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: PostgreSQL / ODBC / Ms-SQL 2000
8+ messages / 2 participants
[nested] [flat]

* Re: PostgreSQL / ODBC / Ms-SQL 2000
@ 2005-09-27 20:11  Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Dave Page @ 2005-09-27 20:11 UTC (permalink / raw)
  To: Thomas Knoop <Th.Knoop@Talisma.nl>; +Cc: pgsql-odbc

 

> -----Original Message-----
> From: Thomas Knoop [mailto:Th.Knoop@Talisma.nl] 
> Sent: 27 September 2005 15:48
> To: Dave Page
> Subject: PostgreSQL / ODBC / Ms-SQL 2000
> 
> Hi Dave,

Hi Thomas,

> With referral to this link:
> http://archives.postgresql.org/pgsql-odbc/2005-08/msg00077.php

Please use the mailing lists for support, not private email.
 
> We are trying to create a view to a linked server in MS-SQL 
> and have the
> same problem, we use the 8.01.00.04 (16-09-2005) version of 
> the ODBC driver.

That bug is fixed - the driver no longer incorrectly reports that we
support catalogs.

> 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.

Regards, Dave.




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL / ODBC / Ms-SQL 2000
@ 2005-09-28 08:38  Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 1 reply; 8+ messages in thread

From: Dave Page @ 2005-09-28 08:38 UTC (permalink / raw)
  To: Thomas Knoop <Th.Knoop@Talisma.nl>; +Cc: pgsql-odbc

 

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org 
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Dave Page
> Sent: 27 September 2005 21:11
> To: Thomas Knoop
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] PostgreSQL / ODBC / Ms-SQL 2000
> 
>  
> > 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.

Regards, Dave



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL / ODBC / Ms-SQL 2000
@ 2005-09-28 17:45  Thomas Knoop <Th.Knoop@Talisma.nl>
  parent: Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Knoop @ 2005-09-28 17:45 UTC (permalink / raw)
  To: pgsql-odbc

 
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.





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL / ODBC / Ms-SQL 2000
@ 2005-09-28 19:04  Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 1 reply; 8+ messages in thread

From: Dave Page @ 2005-09-28 19:04 UTC (permalink / raw)
  To: Th.Knoop@Talisma.nl; pgsql-odbc



-----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



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL / ODBC / Ms-SQL 2000
@ 2005-09-29 16:25  Thomas Knoop <Th.Knoop@Talisma.nl>
  parent: Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Knoop @ 2005-09-29 16:25 UTC (permalink / raw)
  To: pgsql-odbc

>>> 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')

Well this does not work either, remember i'm creating a view....

Let me give some background: I'm using the PostgreSQL as a datasource from
an application that only connects to MS-SQL.

So either I create a view in MS-SQL or I talk to a linked server in MS-SQL
directly. 

But both don't work in the current version. 

- In the linked server setup i need to supply a catalog (of which the driver
does not seem to support)
- In the view it also complains about the catalog that is not supplied... 

Would it be strange to suggest that we use a 'dummy' catalog in the ODBC
driver for MS-SQL?

Best Regards,
  Thomas.





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL / ODBC / Ms-SQL 2000
@ 2005-09-30 08:39  Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 1 reply; 8+ messages in thread

From: Dave Page @ 2005-09-30 08:39 UTC (permalink / raw)
  To: Thomas Knoop <Th.Knoop@Talisma.nl>; pgsql-odbc

 

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org 
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Thomas Knoop
> Sent: 29 September 2005 17:26
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] PostgreSQL / ODBC / Ms-SQL 2000
> 
> >>> 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')
> 
> Well this does not work either, remember i'm creating a view....

CREATE VIEW foo AS SELECT * FROM OPENQUERY(MYLINKEDSERVER, 'SELECT *
FROM public.mytable WHERE foo < 10 LIMIT 5')


> Let me give some background: I'm using the PostgreSQL as a 
> datasource from
> an application that only connects to MS-SQL.
> 
> So either I create a view in MS-SQL or I talk to a linked 
> server in MS-SQL
> directly. 
> 
> But both don't work in the current version. 
> 
> - In the linked server setup i need to supply a catalog (of 
> which the driver
> does not seem to support)

As I already pointed out, the correct syntax is SERVER..schema.table.
However, SQL Server still doesn't like doing this with psqlODBC, as
others on the net have found it also doesn't work with Oracle.

> - In the view it also complains about the catalog that is not 
> supplied... 
> 
> Would it be strange to suggest that we use a 'dummy' catalog 
> in the ODBC
> driver for MS-SQL?

That won't work because the driver would then report the servers
capabilities incorrectly to applications which may then generate invalid
queries.

Regards, Dave



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL / ODBC / Ms-SQL 2000
@ 2005-09-30 09:12  Thomas Knoop <Th.Knoop@Talisma.nl>
  parent: Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Knoop @ 2005-09-30 09:12 UTC (permalink / raw)
  To: 'Dave Page' <dpage@vale-housing.co.uk>; pgsql-odbc

Hi Dave,
 
>>> SELECT * FROM OPENQUERY(MYLINKEDSERVER, 'SELECT * FROM 
>>> public.mytable WHERE foo < 10 LIMIT 5') 

>> Well this does not work either, remember i'm creating a view....

> CREATE VIEW foo AS SELECT * FROM OPENQUERY(MYLINKEDSERVER, 
> 'SELECT * FROM public.mytable WHERE foo < 10 LIMIT 5')

;) Yes, thanks, what i mean is that this view is limited to 5 records

The application that needs to use this view treats this view as a table, and
it will not get any result (or at least limited to the 5 records) from it
because it executes this command on the view:

SELECT FLD1, FLD2 FROM foo WHERE (FDL1 = 20000)

> However, SQL Server still doesn't like doing this with psqlODBC, 
> as others on the net have found it also doesn't work with Oracle.

So does that mean then it will never work in this 'native' mode with MS-SQL
and Oracle?

>> Would it be strange to suggest that we use a 'dummy' catalog in the 
>> ODBC driver for MS-SQL?

> That won't work because the driver would then report the servers
capabilities 
> incorrectly to applications which may then generate invalid queries.

But the driver could ignore the catalog and rewrite those commands, could't
it?

Thanks again for your thoughts on this!

Best regards,
  Thomas.





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL / ODBC / Ms-SQL 2000
@ 2005-09-30 09:27  Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Dave Page @ 2005-09-30 09:27 UTC (permalink / raw)
  To: Thomas Knoop <Th.Knoop@Talisma.nl>; pgsql-odbc

 

> -----Original Message-----
> From: Thomas Knoop [mailto:Th.Knoop@Talisma.nl] 
> Sent: 30 September 2005 10:12
> To: Dave Page; pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] PostgreSQL / ODBC / Ms-SQL 2000
> 
> Hi Dave,
>  
> >>> SELECT * FROM OPENQUERY(MYLINKEDSERVER, 'SELECT * FROM 
> >>> public.mytable WHERE foo < 10 LIMIT 5') 
> 
> >> Well this does not work either, remember i'm creating a view....
> 
> > CREATE VIEW foo AS SELECT * FROM OPENQUERY(MYLINKEDSERVER, 
> > 'SELECT * FROM public.mytable WHERE foo < 10 LIMIT 5')
> 
> ;) Yes, thanks, what i mean is that this view is limited to 5 records
> 
> The application that needs to use this view treats this view 
> as a table, and
> it will not get any result (or at least limited to the 5 
> records) from it
> because it executes this command on the view:
> 
> SELECT FLD1, FLD2 FROM foo WHERE (FDL1 = 20000)

That will always require an unrestricted select from the PostgreSQL
table then - there's nothing you can do about that because QA will need
to join the PostgreSQL and SQL tables locally.

> > However, SQL Server still doesn't like doing this with psqlODBC, 
> > as others on the net have found it also doesn't work with Oracle.
> 
> So does that mean then it will never work in this 'native' 
> mode with MS-SQL
> and Oracle?



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2005-09-30 09:27 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-27 20:11 Re: PostgreSQL / ODBC / Ms-SQL 2000 Dave Page <dpage@vale-housing.co.uk>
2005-09-28 08:38 Re: PostgreSQL / ODBC / Ms-SQL 2000 Dave Page <dpage@vale-housing.co.uk>
2005-09-28 17:45 ` Thomas Knoop <Th.Knoop@Talisma.nl>
2005-09-28 19:04 Re: PostgreSQL / ODBC / Ms-SQL 2000 Dave Page <dpage@vale-housing.co.uk>
2005-09-29 16:25 ` Thomas Knoop <Th.Knoop@Talisma.nl>
2005-09-30 08:39 Re: PostgreSQL / ODBC / Ms-SQL 2000 Dave Page <dpage@vale-housing.co.uk>
2005-09-30 09:12 ` Thomas Knoop <Th.Knoop@Talisma.nl>
2005-09-30 09:27 Re: PostgreSQL / ODBC / Ms-SQL 2000 Dave Page <dpage@vale-housing.co.uk>

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