I have to create database by passing name of the database as parameter in stored procedure in postgressql.
Loading
I have to create database by passing name of the database as parameter in stored procedure in postgressql.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Gajendra JangidPosted Mar 12, 2022, 10:08 AM
Until PostgreSQL version 11, both stored procedures and user-defined functions were created with the CREATE FUNCTION statement. However, beginning with PostgreSQL version 11, procedures can be created using the CREATE PROCEDURE statement.
Suraj DubeyPosted Jan 22, 2022, 5:52 AM
PERFORM replication.dblink_connect('myconn','host=127.0.0.1 port=5432 dbname=mydb user=username password=secret');PERFORM replication.dblink_exec('myconn', 'CREATE DATABASE "DBFROMUSER'||id||'" TEMPLATE "TEMPL'||type||'";',false);PERFORM replication.dblink_disconnect('myconn');Muhammad Imran AnsariPosted Jan 21, 2022, 11:29 AM