Redshift Grant Statements Taking a very long time - amazon-redshift

I am running an SQL script called by workbench/J in CLI to execute about 15 grant statements. This takes well over 30 minutes. The data has not changed, and all other types of statements run at their regular speed. Workbench Build 119

Related

PostgreSQL - long running procedure reasumes after 30 minutes

Enviroment:
Cluster with 3 DB servers managed with Patroni.
PostgreSQL 14.
I have procedure without parameteres which archive some data and works a long time.
When I running it, after exactly 30 minutes this procedure start again. I know it because on the beginnig I insert record into control table with information about start date.
Do you know what process can responsible for it ?

GCP SQL inserts are extremely slow

I have a basic Postgres instance in GCP with the following configuration:
https://i.stack.imgur.com/5FFZ6.png
I have a simple python script using pycopg2 that does inserts in a loop to the database connected through the sql auth proxy.
All the inserts are done in the same transaction.
The problem is that it is taking a couple of hours to insert around 200,000 records.
When I run the script on a local database it takes a couple of seconds.
What could be causing this huge difference?

postgres pg_dump DB backup

I'm using pg_dump in script which runs everyday in night to take backup of multiple DBs. we have around 20 DBs and we noticed that one DB backup takes more than 6 hrs and then got failed and after that other DBs backup started. is there anyway to fine tune this? instead to pg_dump wait for many hrs to finish that broken DB backup?
Thanks
Run the dump scripts for each database in separate scripts so they are not dependent on each other. Otherwise use the third party solutions suggested in comment.

PostgreSQL execute statement on same user - but with different privilidges

I need to run multiple user-defined SQL scripts - some using schema modification privileges, others only data modification privileges.
I can do this by executing them using different users (with adequate privileges), however I need to execute all scripts in single transaction.
Is there a way to specify privileges for single SQL statement on existing connection?
Thank you!

Setting up environment for SQL queries

I know the basic syntax of queries but otherwise I'm a beginner with SQL.
I have an SQL file (.sql) and I downloaded a couple programs (pgadmin and sql workbench).
I have no idea how to get from where I am now to actually writing queries and finding information. How do I set up so I can actually import my SQL file and start writing queries?
pgAdmin is the default GUI for PostgreSQL.
SQL Workbench is a free, DBMS-independent, cross-platform SQL query tool.
Either way, you need to connect to a database to actually run queries. The DBMS can either run on your local machine or you can connect to a remote server - where you need access privileges of course.