Friday, April 18. 2008Using DbLink to access other PostgreSQL Databases and ServersPrinter FriendlyRecommended Books: PostgreSQL 8.4 Internals and Appendices
Comments
Display comments as
(Linear | Threaded)
For the ones who understand pt_br:
http://blog.geekleet.com.br/2008/12/10/dblink-no-postgresql/ The centered link is a SQL function that creates "dbTableLinks" based on metadata of the postgres' metatables... enjoy it ;D []s
Interesting article to an Oracle person used to using DBLINKs in Oracle.
Questions. Is it possible to create a table via a dblink query without specifying the data types of the attributes in the select list? In addition, how can one create a table to hold the queried data without having to know the data types of the attributes in the table (create table as select * from ....). regards Simon
Simon,
Unfortunately there is no way to do it to my knowledge without specifying the datatype. This is a cause of great frustration for me since I'm used to SQL Server OpenQUERY, Openrowset where you don't need to specify the data types. Its an issue with stored functions that return untyped rows as well such as the tablefunc crosstab feature. I haven't checked in 8.4 if this has changed or not . I suspect it hasn't but has come up quite a bit in discussions.
This is a good posting and thought I'd give it a try. But ran into trouble when I tried connecting to my local SQL 2005 server.
I tried a basic command like this: select dblink_connect('host=192.168.1.103 port=1433 dbname=testDB user=test password=password'); I keep getting a could not establish connection. This there something different I need to do? Regards, Flex
Flex,
can't use dblink to connect to SQL Server (well I think you might be able to but requires extra drivers which we haven't attempted.) dblink is more designed for postgresql to postgresql connectivity. For SQL Server -- its generally easier to go the other way use SQL Server to connect to PostgreSQL. Sadly SQL Server cross connectivity is much better and robust than PostgreSQL's linking feature. This will probably change in later versions in PostgreSQL's once the SQL/MED initiative really starts moving. Check out our http://www.postgresonline.com/journal/index.php?/archives/103-Using-Microsoft-SQL-Server-to-Update-PostgreSQL-Data.html
PLEASE HELP!
When I am using dblink, there is shown an error when the connection to the remote database is down. I dont want to the unproffesional error connection is showup, please help me what should i do. When we use SELECT dblink_connect('dbname..etc.') the result query is 'OK' if the connection is good. But the error message appear when connection down. How do i manage the error, so the result query return to 'NOT OK' if the connection is down. Thanks a lot, i am very dizzy to find this out Example:
Can any one help me in loading the dblink.sql into the database.
I use pgAdmin III on a Postgres version 8.3
We want to use dblinks in our reporting application between our reporting postgres db and the vendor postgres db. Unfortunately we do not want to expose the clear text password in our our dblink statements. Is there a workaround?
Thanx for any help.
He tratado por todos los medios de instalar dblink en postgres bajo windos y no tengo éxito. Les agradezco una ayuda o luz al respecto. Gracias¡¡!
|
Entry's LinksQuicksearchCalendar
Categories
Blog Administration |
Tracked: Jan 29, 01:40
Tracked: Jan 27, 05:38