PostgreSQL - Get started
How to provision PostgreSQL ?
To get started, head over to ITCare and search your target Global Service where you will create your new PostgreSQL.
Search your Global service in the top search bar and click on it to display its information page.
Once inside your Global Service, click on the Create Resource button and then select PostgreSQL.
Go to Managed databases and select PostgreSQL and pick the required version.
Fill in the form then click Next. Select your customizations and click Next.
Review the synthesis before submitting the form.
Once the deployment is ready, you will be notified by email.
How to manage your PostgreSQL ?
On the resource page of your PostgreSQL, you can take any action available by using the Manage button in the upper right corner. This includes, starting, stopping, deleting, rebooting, resizing and much more.
How to access your PostgreSQL cluster ?
When your cluster is created with cegedim.cloud ITCare, you obtained an sql role with credentials.
With these credentials, you may connect to the cluster with its name on tcp port 5432. You may use postgres database to connect to.
If your cluster is named "mycluster", here is an example on how to connect using Python:
How to access your PostgreSQL cluster with TLS/SSL ?
When your cluster is created with cegedim.cloud ItCare, you obtained an sql role named "admin" with credentials.
If you choose to activate TLS, you have received the root certificate you should trust to and give to the library you used to connect, for example psycopg2.
With these credentials, you may connect to the cluster with its name on tcp port 5432. You may use postgres database to connect to.
If your cluster is named "mycluster" here is an example on how to connect using Python:
How to create a role ?
It is safer than to not use an admin role for applications. Once connected, you may create a regular role as the following (replace <a_role> and <very_strong_password> with your own credentials)
How to create a database ?
if you want create a database whom owner will be the role you have just created, use the following SQL requests :
How to create a database with another encoding and/or collation ?
You may use the following SQL requests with template0 database as template database:
How to restore in self-service ?
The PostgreSQL PaaS has a functionality allowing to restore a PostgreSQL PaaS (source) to another PostgreSQL PaaS (destination) at a given time (using Point-In-Time Recovery) under the following constraints:
the user must have access to the cloud of the source farm and the destination farm
the source must be backuped (option chosen during creation)
both source and destination must be active
the source and destination must be different
the source and destination must be in the same version of PostgreSQL
the source and destination must be in version 12 or higher
the target time must not be in the future (bounded on the right by the current time).
the time target must not be less than 7 days (for non-production services) or 14 days (for production services) from the current time (bounded on the left by the retention of backups)
You can choose to include or exclude the time target in the restoration process.
How to install the oracle_fdw extension?
You can install the oracle_fdw extension on your databases. This extension allows you to connect to a PostgreSQL deployment and read/write tables that are actually located on an Oracle server. To do this, using ITCare, go to the Manage menu, then Manage Extensions, select your database, then oracle_fdw, and click the Submit button. Remember that according to best practices, you have created a role and a dedicated database:
Once the extension is installed, you must create several objects in the database. You must have the following items to perform this operation:
the username and password for the account (admin) that was provided to you when you created your PostgreSQL deployment.
the role that will connect to the PostgreSQL database and access the Oracle database
The SID of the Oracle database
The username and password for the role that has the right to connect to the Oracle database and read/write the tables in question.
The name and definition of the Oracle tables
For the rest of this example, we will assume that a table has been created in Oracle as follows:
Using your admin account on the customer database, you must create a mapping between your Oracle server, the Oracle database, and the Oracle role (the role that created the person table, for example)
Finally, with the myrole role, connected to the customer database (in PostgreSQL):
If an error occurs when declaring the correspondences between the server and the Oracle role, the admin role can make the following changes:
The documentation for the oracle_fdw extension is available here.
How to install the postgres_fdw extension?
You can install the postgres_fdw extension on your databases. This extension allows you to read/write tables located in another PostgreSQL deployment. To do this, using ITCare, go to the Manage menu, then Manage Extensions on your pg16 deployment, select your database, then postgres_fdw, and click the Submit button. Remember that according to best practices, you have created a role and a dedicated database on each of the PostgreSQL deployments:
On the pg15 server in version 15, for example (pg15.pg.cegedim.cloud)
On the pg16 server (pg16.pg.cegedim.cloud):
With the admin role on the customer database of the pg16 deployment, create the mappings with the pg15 server and the rolea role:
With the roleb role on the pg16 deployment, customer database, import the definition of the mytable table:
Demos
Restoring a PostgreSQL Database
The process of restoring a PostgreSQL database is an important step. Let's see how to proceed below:
Last updated

