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

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.

Related

SQL Developer missing a library

I'm fairly new to Oracle SQL developer. As I'm trying to make a new connection via TNS, I'm getting this error down below which I've been looking to solve for a while fruitlessly.
Error Message:
Statut : échec -Echec du test : no ocijdbc18 in java.library.path
Assuming MySQL is a typo (You are using port 1521, which is the default port for Oracle database, also its giving you ODBC error, so I assume its an Oracle database. Remember that you can connect SQL developer to a MySQL database, so please clarify if you want to connect to a MySQL database rather than Oracle) your problem is due to lack of Oracle Data Base Connector driver (ODBC). From this link download the latest version of Oracle Instant client and install it on your machine. Then define ORACLE_HOME to the path of Instant client installation (To the actual installation folder, the one that contains folders like bin, network and so on) and restart SQL Developer, then you should be good to go.
P.S. : as #thatjeffsmith has mentioned correctly in the comments, it's not necessary to have Oracle Client and/or ODBC (or similar) drivers in order to connect to an Oracle database. Using basic as the connection type and adding the correct connection info would suffice. This Article in Oracle Magazine has extensively talked about the different connection types.

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

Postgres link to Big Query using ODBC drivers

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.

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?

How to connect to particular database in Oracle 10g

Suppose I have multiple Oracle databases in the same server. Now I want to connect to particular database and query a table just like SQL Server 2008. How to start particular Oracle database?
If you are using SQL*Plus, the most common syntax for opening a connection is
sqlplus user_name/password#tns_alias
In this example TNS_ALIAS is the TNS alias for the particular database you want to connect to (most likely "XE" based on your followups to inium's answer). If you want to connect to a different database, you would need to specify a TNS alias for that specific database.
Note that since you are coming from a SQL Server background, the SQL Server definition of a database is rather different than the Oracle definition. What SQL Server calls a database is similar logically to what Oracle calls a schema (and similar physically to what Oracle calls a tablespace). So when you're dealing with Oracle, it's much more common to have many schemas in a single database than to have a large number of databases on a server. This is particularly true if you're using the Express Edition (Oracle XE) where you're generally limited to one database per machine.
go to cmd and type sqlplus <database-name>/<database-password>
You can use SQL Developer, it's similar to SQL Enterprise Manager 2005. Just create a new connection using the db user name and password.