close
close

So geht PostgreSQL | Computer week

So geht PostgreSQL | Computer week

PostgreSQL on macOS installation

Mac users often use Package Manager Homebrew, an Open Source project suitable for installation. The functionality of PostgreSQL and all the settings with a simple installation are: brew install postgresql. It is possible that a specific PostgreSQL version is used in the installation – this is used when using the Befehl brew install postgresql@12.

Another possibility that PostgreSQL is installed under macOS is the Drittanbieter-Lösung Postgres.app, the database repackaged as a native Mac app.

The projects website contains an installer for the active versions of PostgreSQL and most GUI clients. Postgres.app can be automatically configured to set up data sending and initialize the user database. These tools can often be used pg_upgrade.

Configuring PostgreSQL on Linux

If you use a Windows installation program, you will be comfortable with all the installation descriptions, a PostgreSQL that you can use. Under Linux hinges It is possible that the hinges are in most cases overtaken by themselves.

Configuring PostgreSQL on Fedora Linux

PostgreSQL is located in Fedora’s default repositories. Over the Order sudo dnf install postgresql-server postgresql-contrib were performed this direct installation. If you activate PostgreSQL, the boot process has started. That goes with:

sudo systemctl enable postgresql

If you run the PostgreSQL Setup script manually, you will need to set up the initial databases. The order is here:

sudo postgresql-setup --initdb --unit postgresql

The Postgres system password, also the password for the account, one of the PostgreSQL services is opened, and defines this with:

sudo passwd postgres

Next, start the PostgreSQL server:

sudo systemctl start postgresql

Set your password for your internal password postgres-User account, also the account, is intended for the direct processing of PostgreSQL that is used. If you connect to PostgreSQL, you can perform the Befehlszeilenanwendung psql out and give the advice \password  postgres An.

The Fedora Wiki is probably no longer available, a PostgreSQL on Fedora Linux is installed. The possibilities described here are based on a basic configuration.

Configuring PostgreSQL on Ubuntu Linux

Ubuntu has the default repositories of PostgreSQL. If you have a target set to Fedora, you can start the process.

By default, PostgreSQL now responds to connections to the local system. There are a few editions of the date /etc/postgresql//main/postgresql.confwobei The version number of PostgreSQL is available. Please check the date # for the Parameter listen_addresses and put this value on '*'.

I still have a legend about the password for the Benutzerkonto party. Follow that command sudo -u postgres psql template1 out, to connect to PostgreSQL, followed by:

ALTER USER postgres with encrypted password 'your_password';

Install your basic package with:

sudo apt update

sudo apt install postgresql

A SHA-256 authentication for connections to data, which displays the date /etc/postgresql/*/main/pg_hba.conf. If your SSL operating system is for the Datenbank template1 with the Benutzer postgres, there is a best address available on the connection page, which is your next information:

hostssl template1 postgres 192.168.122.1/24 scram-sha-256

Set the PostgreSQL service to Autostart and start it if it is new, then the following operations will occur. The functionality is:

sudo systemctl enable postgresql.service

sudo systemctl restart postgresql.service

Connect to the user and connect to test the server:

sudo -i -u postgres

psql

After all, there are no beaches here postgresql-setup-The step is necessary.

Daten zwischen Migrate PostgreSQL versions

Version 16 includes PostgreSQL which has likely gone through a lot of effort to migrate some version upgrades.

  • The Utility pg_upgrade is the preferred way to migrate data between PostgreSQL versions. If you typically use the application, when a new PostgreSQL version has a different wanted installation. That’s why you start pg_upgrade over the new installation, refer to the other and let the data übertragen. If the migration flow is adjusted, you can use the service program that contains the only revision of the postgreSQL data formats. It has never been realized that it is the best art of the migration.
  • Another example, the data of the postgreSQL versions of the migration of the replica – beispielsweise with Slony. Here the new version of PostgreSQL is used, a Standby server for the server that is set up, while the other version is removed. This method is adapted to the lightness of the time, which is displayed in the background. When the replication is completed, it may be that all connections are no longer on the new server. If the response is not used, this method cannot be used.
  • The service program pg_dumpall export the whole Install a PostgreSQL server in one or more SQL dump files. The resulting script or archive can be saved or imported to the new server. This is possible, the other and the new server can not be set up and the utility is used, a dump operation is performed in “pipes”. Der grote Nachteil von pg_dumpall is that it is slowly. It seems that this method is being reclaimed as a fallback option.

Install pgAdmin 4

A PostgreSQL installation for managing the Drittanbieter-Tool pgAdmin 4 is a handy, web-based GUI. It may be that the tool is so that it is used, while it is written in Python and probably has removed the program extension.

pgAdmin 4 Screenshot 16z9 GERMANY ONLY

The pgAdmin-4 Tool provides a comfortable interface, with a PostgreSQL installation for you to use.

pgAdmin.org

(FM)

Is there another interesting question about different themes from the IT-Welt lesson? Unsere kostenlosen Newsletter if you want to delete everything, delete IT professionals – directly in your inbox!