I am used to Oracle and to create a dblink in my schema and then access to a remote database like this: mytable@myremotedb, is there anyway do to the same with PostgreSQL? Right now I am using dblink like this: SELECT logindate FROM dblink('host=dev.toto.com user=toto password=isok dbname=totofamily', 'SELECT logindate FROM loginlog'); When I execute this command I get the following error: HINT: No function matches the given name and argument types. You might need to add explicit type casts. Does anybody have an idea? Do we have to 'activate' dblinks or do something before using them? Is there something to do on the remote database we are going to query? Do we have to activate dblink too? Question: How do I test a database link? I have a database link but I cannot seem to access any data over the link. Is there a troubleshooting process. I keep having a could not establish connection. This is the line is type: SELECT dblink_connect_u('host=x.x.x.x dbname=mydb user=root port=5432'); IP Address is correct and Postgres is running on the remote server. With PostgreSQL 9.1 or later, installation of additional modules has been simplified. Can be installed with: CREATE EXTENSION dblink; Installs into your default schema ( public by default). Make sure your is set properly before you run the command and the schema is visible to all users who have to work with it. Run once per database. Or run it in the standard system database template1 to add it to every newly created DB automatically. You need to have the files providing the module installed on the local machine first. For Debian and derivatives this would be the package - for PostgreSQL 9.1, obviously.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2018
Categories |