I am using Postgres DBlink (using SSL), but I have no idea of how it is implemented in Postgres.
My question is, what protocols/technologies does Postgres DBlink use?
Like websockets? http?
Dblink uses a standard libpq connection under the hood. The same that is used in any postgres client. It's not websocket, it's not http.
It's a custom, Postgres specific binary protocol.
If you want more details then read this: https://www.postgresql.org/docs/current/static/protocol.html
Based on a glance at the implementation of dblink, it is using a regular Postgres database connection, which is of the type PGconn.
So the technologies and protocols used depend on the connection string you provide to the function. For example, if you provide the parameters necessary to connect with SSL, then it will attempt to use SSL.
Related
I trying to connect to GCP Postgres. The most convenient method my environment has is an ODBC driver. Will GCP serve that type of connection?
That should work. The server doesn't know it is talking to an ODBC driver. It speaks its native protocol, it is up to the ODBC driver to interpret that.
I want to show some pgbouncer stats in a simple wpf client (npgsql), but I can't connect to pgbouncer. The connect to a postgresql database via pgbouncer is working well, but the connect to pgbouncer admin database is not. With the used credentials I don't have any problems to connect with psql.
The Code:
var connString = "Server=X.X.X.X;Port=6432;User Id=pgbouncer;Password=myPw;Database=pgbouncer;";
using (var con = new NpgsqlConnection(connString))
{
await con.OpenAsync();
return (await new NpgsqlCommand(sql, con).ExecuteScalarAsync()).ToString();
}
I get the error 08P01: unsupported pkt type: 80 on opening the connection.
In this post the problem could be solved by an extra parameter in the jdbc connectionstring, but this parameter seems unavailable in a npgsql connectionstring.
How can I get some pgbouncer stats in a c# client?
EDIT:
In the meantime I tried Devart provider (Express edition), but it don't work too, because the provider commits a SELECT VERSION(); during the connect, and the pgbouncer database don't understand this statement => Exception. In pgbouncer forum I can't find a solution as well.
I can't believe that this task apparently is so rarely. I'm really surprised.
PostgreSQL has two query protocols at the wire level - the simple protocol and the extended protocol; it seems that the pgbouncer admin interface supports only the simple protocol, but Npgsql only supports the extended protocol. That unfortunately means that the two are incompatible at the moment.
This issue tracks adding support for the simple protocol to Npgsql.
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).
Here is my connection string: mysql://admin:RandomString#sl-us-south-1-portal.serverNumber.dblayer.com:MyPORT/compose
Is the "RandomString" my password (obviously I changed it). Or what is that?
Or is there another IDE I can use to create the database? I am by no means dedicated to Workbench. I'm actually a SQL Server guy. Maybe a PostgreSQL instance has a web-IDE?
Yes, it is your password. A connection string is laid out in the RFC compliant format (specifically https://www.rfc-editor.org/rfc/rfc3986).
scheme://username:password#host:port/path
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.