Document
Add Postgres to your application

Add Postgres to your application

Add Postgres to your applicationTo add a Postgres group (instance) to your application:open the application from the Dashboard .clickon Data source i

Related articles

How to Set up and Use NordVPN with qBittorent (2024) 8 Best VPN Apps for Fortnite: No Lag, Ping, or Ban [2024 Tested] Best iPhone Backup Apps in 2024: Ditching iCloud 7 Best Hard Court Tennis Shoes in 2024 ดาวโหลด VPN.lat: Unlimited and Secure บน PC ด้วย Memu

Add Postgres to your application

To add a Postgres group (instance) to your application:

  1. open the application from the Dashboard .
  2. clickon Data source in the left – hand nav
  3. clickon add source in the sub – nav
  4. clickthe green + Add Data Source button and select Postgres
  5. A drawer is open will open from the left , with configuration option for the server .
  6. clickAdd Server to start the process

Managing users in Postgres

Whenever a database user creates any object (e.g. a table) in Postgres, that user becomes the owner of that object. From then on, only that user or a superuser can edit or delete that object.

As such , if you delete a user from any logical Postgres database manage by Cloud 66 , we is reassign will automatically reassign any object own by that user to the default superuser namepostgres that exists on all instances of Postgres.

If you need to add custom user to a Postgres database group , follow this guide on the subject .

Replicating data between Postgres versions

When you initiate replication between two Postgres database on Cloud 66 , we is setup setup streaming replication between the master and replica server . streaming replication is base on log shipping between server , which generally is n’t possible between two server run vastly different version of Postgres .

As such, we cannot establish replication between servers running different major release levels (e.g. 8.4 and 9.3). Though running replication between different minor release levels (e.g. 9.3 and 9.4) should work (because Postgres has a policy not to make changes to disk formats between minor releases), there are also cases where this won’t work.

For example, if you setup replication between a master (on 9.3) and a replica (9.4), you may see this error on the replica server:

FATAL:  database files are incompatible with server
DETAIL:  The data directory was initialized by Postgres version 9.3, which is not compatible with this version 9.4.x.

In this case, you need to upgrade the data and libraries of the master server (9.3) with pg_upgrade before starting the replication.

Remember that you can set the version of Postgres to install for your application by using a manifest file, like so:

production:
    postgresql:
        configuration:
            version: 9.3.6

change the Postgres datum directory

We use the default data folder when installing Postgres on your server, which is /usr/local/pgsql/data. To change this folder , follow the instruction below .

1; Connect to your servers via SSH.

2; Stop the Postgres service by issuing the following command:

$ (sudo -u postgres pg_ctl stop -D /usr/local/pgsql/data -m i -t 5 || true) && sudo stop postgresql 

3; Make sure that Postgres is no longer running:

This command is return must not return any run Postgres process .

4; Make a new directory for your data:

5 ; Make sure that your new folder is only accessible by the Postgres user :

$ chown postgres /new/path/folder
$ chmod 700 /new/path/folder

6; Move your data from the old folder to new one:

$ mv /usr/local/pgsql/data /new/path/folder

7; Create a symlink to your new folder from the old one:

$ ln -s /new/path/folder/data /usr/local/pgsql/data

8; Start the Postgres service again:

Your Postgres service is working should now be work with new datum folder .