Re: Connect to SQL Server via ODBC from Postgresql

Поиск
Список
Период
Сортировка
От Afewtips.com
Тема Re: Connect to SQL Server via ODBC from Postgresql
Дата
Msg-id 1850e97f-d050-413f-a3f4-92e21c727327@j20g2000hsi.googlegroups.com
обсуждение исходный текст
Ответ на Connect to SQL Server via ODBC from Postgresql  ("Afewtips.com" <afewtips@gmail.com>)
Ответы Re: Connect to SQL Server via ODBC from Postgresql  (Sim Zacks <sim@compulab.co.il>)
Re: Connect to SQL Server via ODBC from Postgresql  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-general
On Jan 4, 10:08 am, "Afewtips.com" <afewt...@gmail.com> wrote:
> Hi,
> I am new to this product and don't quite know what can and cannot be
> done.
>
> I need to submit queries to a SQL Server database and create a table
> in Postgresql with the results from SQL Server.
>
> Normally I would do this with an ODBC driver into SQL Server, but I
> don't see any references to doing that with Postgresql, only connect
> to the Postgresql table from another database with ODBC.
>
> I do read mentions about dblink connections, but how to install it
> looks unclear and complicated.
>
> (I didn't install the PostgreSQL source and it seems that it is needed
> to install dblink. Does dblink have a standard application install?)
>
> I am running 8.2 - any help would be very appreciated!
>
> Thanks

I think I may have figured it out - so this may be useful to someone
as well.

I installed the enterprise server and it had everything installed and
the syntax that I am using and works is:

select * from dblink('hostaddr=000.00.00.00 port=1433 dbname=db
user=username password=password',
'select fieldname from ext_database')
as t1(fieldname text) ;

The objective is to connect and submit a query from Postgresql into a
SQL Server database and return the results.

And from what I read, I can create a view from the above string and
connect more easily with the view.

В списке pgsql-general по дате отправления:

Предыдущее
От: "O'Shea, Brendan"
Дата:
Сообщение: Re: ERROR: catalog is missing 9 attribute(s) for relid 10297
Следующее
От: Sergei Shelukhin
Дата:
Сообщение: deadlock priority?