How to drop a PostgreSQL database if there are active connections to it?

I need to write a script that will drop a PostgreSQL database. There may be a lot of connections to it, but the script should ignore that. The standard DROP DATABASE db_name query doesn’t work when there are open connections. How can I solve the problem? This will drop existing connections except for yours: Query pg_stat_activity and get the … Read moreHow to drop a PostgreSQL database if there are active connections to it?

Permission denied in Postgres

I added the user myuserto Postgres. Then I added the database mydatabase in the pgAdmin III GUI and restored from a backup file. So the owner of mydatabase is the superuser postgres. Then I tried to give all rights to access and modify mydatabase to myuser. I logged into psql as user postgres: psql -d template1 -U postgres and then I ran this query: GRANT ALL PRIVILEGES … Read morePermission denied in Postgres

Install Sublime Text 3 in Ubuntu 16.04 & Higher The Official Way

The popular cross-platform Sublime Text editor finally offers official Linux apt repository to make it easy to install and receive update in Ubuntu. Sublime Text is a proprietary source code editor with a Python API. It supports many programming languages and markup languages, and its functionality can be extended by users with plugins. It’s available to download and use … Read moreInstall Sublime Text 3 in Ubuntu 16.04 & Higher The Official Way

How do I install pgadmin 4 on ubuntu?

Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg. In the example, replace stretch with the actual distribution you are using: deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main i.e.deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main (You may determine the codename of your distribution by running lsb_release -c). For a shorthand version of the above, presuming you are using a supported release: sudo sh -c ‘echo “deb http://apt.postgresql.org/pub/repos/apt/ codename-pgdg … Read moreHow do I install pgadmin 4 on ubuntu?

How to Migrate Windows 10 from HDD to SSD Using Clonezilla

This tutorial represents a practical excerpt on how to migrate (also known as cloning) a Windows 10 Operating System from a large HDD with multiple partitions, such as C:, D:, to a smaller SSD using a Linux distribution which includes Clonezilla utility. Clonezilla utility can run from PartedMagic Linux distribution CD ISO image or directly from Clonezilla Linux … Read moreHow to Migrate Windows 10 from HDD to SSD Using Clonezilla