cancel
Showing results for 
Search instead for 
Did you mean: 

Can I connect my web app or pgadmin to PostgreSQL on SAP cloud platform?

Former Member

Hi Team,

I've created PostgreSQL instance on SAP cloud Platform and created access key for it.

The access key provides me the login information (DB Name, Hostname, username and etc..) but when I'm trying connect from my PgAdmin or form my web app in SCP VM (Python Django app) I'm facing to errors.

I'd like to know whether if I can use Pgadmin to connect postgres or I can only us Node.js app, Java app and BYOL app.

Thanks beforehand.

Regards,

Arman

gregorw
Active Contributor

Wouldn't it be the easiest to deploy your python app using Cloud Foundry? Then you should be able to consume the PostgreSQL service.

Former Member
0 Kudos

My App running on SAP Cloud Platform VM but we are doing development in our PC's and wee need to connect to the db during the developmenr.

Regards,

Arman

gregorw
Active Contributor
0 Kudos

I think it would be better do have a local db instance during development to be independent from the central db.

0 Kudos

Hi Arman,

I don't have success trying to connect to a postgresql instance from a pgAdmin running on localhost. In my previous team we deployed a PostgreSQL Studio (http://www.postgresqlstudio.org/) as a web app in the space and this web app was the web version of pgAdmin. Then we created a binding and finally we managed to connect to the postgresql instance from the studio. Now their web page returns 403 forbidden to me and I am unable to download the war file. I was just a war file and all you need to do was to invoke cf push. I guess you will be able to find some web ui alternatives for pgAdmin. It will be useful if some colleagues can recommend something that they already used. I also know from colleagues that there is a cf plugin that "opens a tunnel" to the remote postgresql and makes possible connection from local pgAdmin. I will try to find more info.

What type is your virtual machine? Is it a SCP vm on Neo env? I am not sure that postgresql service will allow connections from some apps/vms that does not have service bindings to it. I will also test this.

Best regards,

Ismail Alidzhikov

Former Member
0 Kudos

Hi Ismail,

It's not only for pgAdmin.

Currently, I'm running Python Django app on SCP's VM and I'm using PostgreSQL and S3 file storage from AWS and Id like to use SAP Cloud Platform instead.

I'm unable to connect to the PostgreSQL from my Django App also (((

Regards,

Arman

0 Kudos

Hi Arman,

I would suggest you to open a ticket to component BC-NEO-INFR-VM describing the error you receive and the colleagues will try to assist you.


Best regards,

Ismail Alidzhikov

Accepted Solutions (0)

Answers (1)

Answers (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Arman,

I am a bit confused. You say you have postgreSQL installed on SCP - but this database is only available on the CF environment.

On the other hand you are using SAP Linux VM to host your applications which sits on Neo environment.

With that said, are you trying to use a local installation of pgAdmin to connect to your CF database? If so, you could open an ssh tunnel to it using cf cli. However, I don't suppose you can connect your python application running on a Linux VM to a database running on CF.

If this is the case, it would be wiser to have your database sitting near to your application. The way you are trying to do, it might not even be possible, but if it did your application would suffer from poor performance.

Choose between either options below:

1) Install both postgreSQL DB and pgAdmin locally on the Linux VM - this will allow you to connect your application easily to the database.

2) Deploy your application on CF directly using a Python Buildpack and read the environment VCAP_SERVICES to connect. The tunnel approach should be valid if you want to connect a local installation of pgAdmin to your database backing service in CF - but I've never tried it before.

To install software on Linux VM, you have to open an ssh terminal to your VM first. There is an excellent blog on VM (neo) and on step 3 the author shows how to connect to it remotely using Neo SDK to open a tunnel.

To install pgAdmin use the second part of the blog that will help you to install software in the linux VM using zypper.

From the second blog: "By default, outbound communication from the virtual machines to the Internet and other systems is allowed, but inbound communication has to be enabled.". This means outbound connectivity is allowed. However, direct inbound on the CF is not!

According to this wiki item 2.3.2, you cannot connect pgAdmin to a database running on SCP.

Best Regards,
Ivan