AWS RDS connect to PgAdmin Error saving properties Unable to connect to server: timeout expired

In this article, we will see the solution for AWS RDS PostgreSQL connectivity from pgadmin.

Error saving properties Unable to connect to server: timeout expired

AWS RDS connect to PgAdmin Error saving properties Unable to connect to server: timeout expired
Continue reading AWS RDS connect to PgAdmin Error saving properties Unable to connect to server: timeout expired

PostgreSQL Error: database is being accessed by other users

In this article, we will the solution for PostgreSQL Error: database is being accessed by other users
Detail: There are 2 other sessions using the database

ERROR  database  is being accessed by other users
Continue reading PostgreSQL Error: database is being accessed by other users

Switch role after connecting to database in PostgreSQL

In this article, we will see how to Switch role after connecting to database in PostgreSQL with examples.

We can switch or change the current use/role as active using set command.
Continue reading Switch role after connecting to database in PostgreSQL

How to find list of active sessions/connections in PostgreSQL database

In this article, we will see how to find list of active sessions/connections in PostgreSQL database.

We can find list of active/inactive sessions/connections by querying against PostgreSQL system view pg_stat_activity.
Continue reading How to find list of active sessions/connections in PostgreSQL database

How to create PostgreSQL User with superuser privileges

In this article, we will see how to create PostgreSQL User with superuser privileges by two ways.

Create PostgreSQL User/Role with superuser privileges by using either of following methods:
1. Create User/Role first then assign superuser privilege.
2. Create User/Role with superuser privileges.

Continue reading How to create PostgreSQL User with superuser privileges

PostgreSQL ERROR: syntax error at or near “VARCHAR”

In this article, we will see the solution for ERROR: syntax error at or near “VARCHAR”.

PostgreSQL ERROR: syntax error at or near "VARCHAR"

Reolution: Continue reading PostgreSQL ERROR: syntax error at or near “VARCHAR”

How to create tablespace in PostgreSQL with examples

In this article, we will see How to create tablespace in PostgreSQL with examples and other actions can be performed related to PostgreSQL tablespace.

What is PostgreSQL tablespace?

A tablespace is a location on the disk where PostgreSQL stores data files containing database objects e.g., tables, and indexes. PostgreSQL uses a tablespace to map a logical name to a physical location on disk.

PostgreSQL comes with two default tablespaces:
pg_default tablespace stores user data.
pg_global tablespace stores global data.

Syntax to Create PostgreSQL Tablespace:

CREATE TABLESPACE tablespace_name [ OWNER owner_name] LOCATION 'directory'

Continue reading How to create tablespace in PostgreSQL with examples

How to start stop PostgreSQL server using pg_ctl

In this article, we will see how to start stop PostgreSQL server using pg_ctl.

We can start or stop or promote PostgreSQL server(cluster) by using following three methods.

1. Using pg_ctl
2. Using Systemctl
3. Using service

Last two methods are straight forward.

How to start stop restart PostgreSQL server using pg_ctl

pg_ctl is the utility used to start stop status or promote/failover of PostgreSQL cluster(server).
To use pg_ctl to start the PostgreSQL, we must have an already existing or newly initialized data directory.
We have to use PostgreSQL server data directory location while using pg_ctl.

Before going to examples, set the PostgreSQL environment variables using this link

Syntax of pg_ctl: Continue reading How to start stop PostgreSQL server using pg_ctl

How to set PostgreSQL environmental variables permanently in Ubuntu Linux

In this article, we will see how to set PostgreSQL environmental variables permanently in Ubuntu Linux step by step.

How to set PostgreSQL environmental variables

Continue reading How to set PostgreSQL environmental variables permanently in Ubuntu Linux