Postgres link to Big Query using ODBC drivers - postgresql

I'm trying to build a link from Postgres (Windows installation) to Google Big Query. In order to do so I've found 3rd party ODBC drivers by Simba, installed and configured successfully. Next step was to create a link in Postgres. I was looking at dblink function in Postgres to do so. Documentation of dblink_connect states that I need to pass libpq-style connection info string which should be similar to hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres password=mypasswd.
Question is how should I create a dblink connection using installed ODBC drivers? What should be my hostaddr and port?
When I am googling for Postgres dblink connection using ODBC I always find how to connect to Postgres instead of from Postgres. Is it at all possible?

You could also simply install the FDW and query forign tables of bigquery: https://github.com/gabfl/bigquery_fdw

Postgres dblink is a module that supports connections to other PostgreSQL databases. It doesn't support ODBC data sources.
You may want to try ODBC-Link which allows to connect to any ODBC data source. Another approach is to use ODBC version of Postgres Foreign Data Wrappers. There are several extensions that implement FDW for ODBC data sources and they are listed on Postgres FDW page.

Related

Relation between postgres and pg-admin

can any one help me with this?
How pg-admin is used with postgresql?
How do they work together?
I want to know the working and the realtion between the two.
pgAdmin is a GUI client specifically written for PostgreSQL. It is written in Python and uses the PostgreSQL C library libpq via psycopg2 to communicate with the PostgreSQL database server.
You need the PostgreSQL server running before you can connect to it with pgAdmin.
pgAdmin is an independent project, and it is written by different people than PostgreSQL (although there are naturally overlaps).

Difference between pgAdmin and PostgreSQL

Can someone tell me the difference between pgAdmin and postgreSQL? Are both of them one in the same? I can't draw a ER diagram in pgAdmin but was wondering if it's possible in postgreSQL?
Once I downloaded the postgreSQL it automatically downloaded the pgAdmin and the postgreSQL database is not in sight.
The PostgreSQL is a database engine implementing SQL standards. It usually listen as a server on a network tcp port to provide its abilities.
The pgAdmin is a sort of client. You are able to manipulate schema and data on an instance or multiple instances of PostgreSQL engines.
The MS Windows instalation package consists of both PostgreSQL server and PgAdmin client. So far right after the instalation you are able to manage your databases.
PostgreSQL (pronounced as post-gress-Q-L) is an open source relational
database management system ( DBMS ) developed by a worldwide team of
volunteers. PostgreSQL is not controlled by any corporation or other
private entity and the source code is available free of charge.
The pgAdmin package is a free and open source graphical user interface
administration tool for PostgreSQL, which is supported on many
computer platforms.
phpPgAdmin is a web-based administration tool for PostgreSQL written in PHP and based on the popular phpMyAdmin interface
originally written for MySQL administration
Hope you can understand now it well!!

Is it possible to connect to a PostgreSQL server using FreeTDS driver and tsql?

I've asked this question on serverfault and someone told me to ask here.
Can I make a connection to a PostgreSQL server using FreeTDS, more specifically using the tsql command?
I've been trying for a few days now, using many different configurations. Even though I am able to connect to the DB using isql and PostgreSQL odbc driver, I can't make it work using tsql (it also doesn't seem to use odbc.ini or odbcinst.ini). So, I was wondering if the tsql command only works with SQL Server.
If you want, I can post the files freetds.conf, odbc.ini and odbcinst.ini.
Thanks.
FreeTDS only supports the TDS protocol (hence the name). And this protocol is only implemented by Microsoft SQL Server and the Sybase database.
So, no you can not use FreeTDS to connect to a Postgres database.
You need to use the Postgres ODBC driver, the Postgres .Net driver or the Postgres JDBC driver to do this - depending on the programming language of your application. From a C program you can also connect to Postgres directly using the libpq library.

What client manager for postgres do you use? Phpmyadmin analog for postgres

colud you tell me what client manager do you use for postgres? I tried phppgadmin and desktop pgadmin but they have a lot of functionality limitations comparing to what phpmyadmin or heidiSql can do for mysql. I'm just wondering is there any good tool for postgres? What do you use?

PostgreSQL: One database to multiple user

I have PostgreSQL 9.3 version. I have created database name db1 now I need it to share with other users who all are connected with the LAN's to connect other applications with the same database.
In SQL Server: We can do this by selecting server name with login details.
Question:
Is it possible in PostgreSQL?
If yes, how can do this?
What is the procedure?
You will need to modify pg_hba.conf to allow remote connections to the database. Information about pg_hba.conf can be found here.
After that, you can connect programatically with a connection string, or similar to your image, with a GUI application like pgAdmin.
To connect (remotely or locally) from pgAdmin choose File -> Add Server... and enter the connection information into the dialog box. Here's an example of the window:
Your client computers will also need to have PostgreSQL drivers as well. If you're doing this in Windows, you'll probably be using ODBC. The PostgreSQL ODBC drivers are here. Info on the connection string format can be found here.
Here's an example of what pgAdmin looks like: