Skip to main content

PostgreSQL

PostgreSQL is a relational database management system (RDBMS) that has become very popular because of its many useful features. It provides a strong, stable platform for storing, organizing, and managing large volumes of structured data. Its SQL compliance and support for a wide range of extensions and plugins make it a good choice for all users.

Connecting PostgreSQL to Adminer gives you a web-based user interface so you can easily manage your data. With this tool, you can create databases, create tables and data in them, edit them, and query them, without needing to write code.

One-Click Deployment​

With Arvancloud Cloud Container ready-made applications, you can set up PostgreSQL together with Adminer with just one click.

Deploy with one click

You can install PostgreSQL on its own or with Adminer from the Cloud Container ready-made applications, and you can choose either one based on your needs.

Using PostgreSQL​

After setting up PostgreSQL and Adminer, you can access Adminer, the PostgreSQL user interface, through the free Arvancloud domain or your own domain (if you set it on this application).

Logging In to the Application​

After accessing Adminer, set System and Server to PostgreSQL and enter the username and password. Your username is root, and your password is the value you entered in the panel when creating the application.

Click Login to enter Adminer and manage your database.

If you use PostgreSQL without Adminer, you can enter it through the console with this command:

psql --username=root

You can replace root with your own username.

Working with Databases and Tables​

You can easily create a new database by clicking Create database.

If you use PostgreSQL without Adminer, you can create a new database with this command:

CREATE DATABASE test
ENCODING 'UTF8'
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
TEMPLATE template0
OWNER postgres;

To create a table in a database, you can use the following structure:

CREATE TABLE table_name (
column1 datatype1,
column2 datatype2,
column3 datatype3,
...
);

For example, the following command creates a table named employees with three columns: id, name, and age:

CREATE TABLE employees (
id serial PRIMARY KEY,
name varchar(100),
age integer
);

Working with Data​

In Adminer, to enter data in the database you created, simply click New item in the table you want and specify the columns and their types.

To add data to a table in the PostgreSQL console, you can use this structure:

INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);

For example, the following command adds three rows of data to the employees table:

INSERT INTO employees (name, age)
VALUES ('Ali Alizadeh', 30),
('Amir Amirzadeh', 28),
('Reza Rezazadeh', 35);

Querying Data​

To search for and retrieve different data, you can use the Search feature in Adminer. In this section, you can specify one column or all of them and use operators to set conditions for searching the data.

If you use PostgreSQL without Adminer, you can use SQL syntax to query:

SELECT * FROM table_name WHERE condition;

For example:

SELECT * FROM employees WHERE age > 30;

For more help, you can use the PostgreSQL and Adminer documentation.