Unable to see Procedures item in a schema in Microsoft Azure PostgreSQL - postgresql

I developed a stored procedure in PostgreSQL in my local machine. And going to deploy it to PostgreSQL in MS Azure. But it's so strange, I did not see "Procedure" item inside a schema.
In Azure
In my local
I guess the user I have used in Azure does not have some permissions to view "Procedures".
If you know about this, please advise me.
Thank,

Related

How to connect PostgreSQL Azure Cloud Server with SQL Developer?

Does anyone know if there is any chance to connect a PostgreSQL Azure Cloud Server with SQLDeveloper?
If someone knows this may you could explain to me how it works.
Or if it doesn't work which IDE should I use for it?
Thanks for helping me out!
You can connect azure PostgreSQL database using Azure Data Studio. I tried to repro this and below are the steps to connect using ADS.
Install Azure Data Studio and Click extensions on ADS and install PostgreSQL.
Click on Connections and in servers, click new connection.
Set Connection type to PostgreSQL and enter the connection details like Server name, username and password. Click connect.
Azure PostgreSQL DB is connected using Azure Data Studio.
Reference: MS document Quickstart: Connect and query PostgreSQL - Azure Data Studio | Microsoft Learn

Refresh postgres materialized view using scheduler

I was trying to figure-out how we can schedule to refresh the materialized view on azure postgres database single server which is in azure cloud, one solution is to use pg_cron extension, but it
seems it is only available on azure flexible postgres database server and not on azure postgres database single server, I did not get any other option available, any suggestion in this regard will be really helpful.
I did not find any postgres scheduler extension for the db hosted on Azure, so created one microservice to schedule the db functions.
Example Link

Copy data from Postgres DB (GCP Project A) to another Postgres DB (GCP Project B)

I would be happy to get your help / feedback re data load.
Goal:
Load source data from a Postgres database, which is located in GCP project A to another Postgres database, which is located in GCP project B.
Challenge:
Get a connection (I have an IAM account with sufficient rights to run a COPY TO / COPY FROM command) to the Postgres DB in GCP Project A and copy the table either to a CSV or create a dump that can be used in order to be inserted to another Postgres DB in GCP Project B.
How do I connect to the database (e.g. if I create a key, where shall I store the json keyfile and would that approach even be feasible?) with this IAM email account?
Other ways I've researched were to use psycopg2 (thus I could use the function cursor.copy_expert (which doesn’t need any superuser right or Postgres user credentials and copy the data), but I didn’t succeed in connecting to the database with psycopg2 due to challenges with cloud proxy.
Another idea was to use pg_dump or gcloud sql export csv.
I would be curious if some of you were facing a similar challenge and how did you solve it and what might be the best way/practice
You can have a try out database migration service. You can set up a continuous migration configuration and use Cloud SQL for PostgreSQL.
Hello after a lot of searching I've come to these solutions:
If you have continuous copy, you need to use the database migration service, check this documentation.
If you have one shot copy:
you can restore your instance, see the bottom page of this documentation
you can create a bucket and backup your instance on it, then import it from the other project

PostgreSQL Job Scheduler on Azure DB for PostgreSQL

In Azure Database for PostgreSQL, how do I install a pgAgent?
As, its a PaaS only, I will not have access to the Server. In that case, if I need a pgAgent to install, how do I do it?
As per azure docs, it seems PgCron is available in flexible server type.

How to backup and restore databases through stored procedure in Azure SQL using Elastic Pool?

I have a C# ASP.NET MVC based web application in which there is a functionality of Archiving (backup) and Restoring Databases on the click of button. Currently, our system is On-Prem and so we are using the stored procedures in SQL Server to do the backup and restore.
Now we are migrating to Azure PaaS and are using Elastic Pool. As the backup and restore T-SQL commands do not work in Azure SQL, so can someone please help me in finding a way to do the backup and restore of DBs manually through T-SQL?
Any help would be highly appreciated!
Auto backups is a feature of Azure SQL database.
In SQL Azure, database backups are executed automatically and it is not possible to change this behavior. This is a service offered when you create a SQL Azure database and the first full backup occurs immediately after you create a new SQL Azure database and the rest of the backups are scheduled by SQL Azure itself.
There is no way can help you backup and restore of DBs manually through T-SQL.
Hope this helps.
Thanks for the quick answer,Leon! :)
So that it could be helpful to other community members, I would like to mention another way to achieve the same as it can't be done by T-SQL.
What I have done instead is, I have used SQLPackage.exe utility embedded in a batch script and executed that batch script through my C# code to achieve the same functionality.